0
我有一个bash脚本,而其他几个programes都开始nohup的(都具有相同的可执行文件,但不同的参数),例如:在bash脚本中循环直到其他任务完成(以nohup开始)?
nohup ./code --p0 &
nohup ./code --p1 &
nohup ./code --p2 &
是否有可能在nohups来电之后写了一个循环,当所有./code
运行完成后终止?
我有一个bash脚本,而其他几个programes都开始nohup的(都具有相同的可执行文件,但不同的参数),例如:在bash脚本中循环直到其他任务完成(以nohup开始)?
nohup ./code --p0 &
nohup ./code --p1 &
nohup ./code --p2 &
是否有可能在nohups来电之后写了一个循环,当所有./code
运行完成后终止?
你似乎在寻找wait
:
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"