Linux 在bash脚本中循环,直到其他任务完成(以nohup开始)?

Linux 在bash脚本中循环,直到其他任务完成(以nohup开始)?,linux,bash,nohup,Linux,Bash,Nohup,我有一个bash脚本,其中几个其他程序是用nohup启动的(所有程序都有相同的可执行文件,但参数不同),例如: 是否可以在nohups调用后编写while循环,该循环在所有/code运行完成后终止?您似乎在寻找等待: nohup ./code --p0 & nohup ./code --p1 & nohup ./code --p2 & wait # This would wait for all currently active child processes ec

我有一个bash脚本,其中几个其他程序是用nohup启动的(所有程序都有相同的可执行文件,但参数不同),例如:


是否可以在nohups调用后编写while循环,该循环在所有
/code
运行完成后终止?

您似乎在寻找
等待

nohup ./code --p0 &
nohup ./code --p1 &
nohup ./code --p2 &
wait    # This would wait for all currently active child processes
echo "This statement would be printed after all nohup calls are finished executing"
nohup ./code --p0 &
nohup ./code --p1 &
nohup ./code --p2 &
wait    # This would wait for all currently active child processes
echo "This statement would be printed after all nohup calls are finished executing"