【发布时间】:2015-06-15 21:23:27
【问题描述】:
我正在尝试通过创建一个包含 shell 命令的 #!/bin/sh 文件来为我的开发服务器启动多个进程。
例如:
#!/bin/sh
read -p "Start all servers? (Y/n)" answer
if test "$answer" = "Y"
then
cd ./www/src; node ./index.js;
cd ./www/; ./gulp;
cd ./api/; nodemon ./init.js;
cd ./api-test/; node ./index.js;
else
echo "Cancelled."
fi
因为例如 nodemon 将设置一个监视进程或节点一个 http 服务器进程,所以第一个命令将启动 (cd ./www/src; node ./index.js;) 而不会继续启动其他进程。
我不知道如何独立启动所有 4 个进程..
有人吗?
【问题讨论】:
标签: shell service terminal bin