cd /tests./test1 &./test2 &./test3 &./test4 exit
我想要的是同时运行所有测试,并且只有在所有先前的测试完成后才执行exit命令.并且不仅在测试4完成时,这可能吗?
谢谢.
./test1 &./test2 &./test3 &./test4 &wait
从bash手册页:
总结wait [n …] Wait for each specifIEd process and return its termination status. Each n may be a process ID or a job specification; if a job spec is given,all processes in that job’s pipeline are waited for. If n is not given,all currently active child processes are waited for,and the return status is zero. If n specifIEs a non-existent process or job,the return status is 127. Otherwise,the return status is the exit status of the last process or job waited for.
以上是内存溢出为你收集整理的linux – 在初始化/ bash脚本中同时执行多个程序全部内容,希望文章能够帮你解决linux – 在初始化/ bash脚本中同时执行多个程序所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)