我想同时运行3个进程,当所有3个进程完成时,我想运行另一个进程。
例如:
./ script1.sh& amp; ./script2.sh& amp;
等待script1和script2完成并运行./script3
感谢您的帮助
答案 0 :(得分:3)
man ksh
wait [ job ... ] Wait for the specified job and report its termination status. If job is not given, then all currently active child processes are waited for.
所以,e。克。
./script1.sh& ./script2.sh& ./script3.sh
wait
./script4.sh
只要没有其他当前活动的子进程,就会这样做。