我有一个流程
"verifyEmail"
I run this in script as verifyEmail 0 1000
现在我如何等到这个过程完成执行后再继续执行 shell 脚本中的下一条指令? verifyEmail 运行需要 60 多分钟
我试过了
while ! checkprocess "verifyEmail"; do ##Checkprocess is a function which returns 0 or 1
sleep 60 ## based on process present or not
done
最佳答案
如果您正常运行该过程,则无需执行任何操作。如果你异步运行它,你只需要等待
:
verifyEmail 0 1000
echo This will print after verifyEmail is done!
或
verifyEmail 0 1000 &
wait $!
echo This will print after verifyEmail is done!
关于Shell 脚本等待进程完成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15508591/