bash 在单个程序中管理多个命令
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26497865/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
supervisord multiple commands in single program
提问by Verhogen
How do I make a program for supervisord execute a command like
我如何为 supervisord 制作一个程序执行类似的命令
make && run-my-app.sh
It seems to try to pass && run-my-app.sh
as arguments to make. I've tried different combinations of quotes around things, but I can't seem to get this syntax right.
它似乎试图&& run-my-app.sh
作为参数传递给 make。我已经尝试了不同的引号组合,但我似乎无法正确理解这种语法。
回答by Peter Szeto
You can enclose it in quotes to make it evaluate as two separate commands instead of making it appear && run-my-app.sh as arguments to make.
您可以将其括在引号中,使其作为两个单独的命令进行评估,而不是将其显示为 && run-my-app.sh 作为要进行的参数。
command=/bin/bash -c "make && run-my-app.sh"