3

我有一个过程

"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 
4

1 回答 1

2

如果您正常运行该过程,则无需执行任何操作。如果你异步运行它,你只需要wait它:

verifyEmail 0 1000
echo This will print after verifyEmail is done!

或者

verifyEmail 0 1000 &
wait $!
echo This will print after verifyEmail is done!
于 2013-03-19T19:33:57.690 回答