3

プロセスがあります

"verifyEmail"
I run this in script as verifyEmail 0 1000

このプロセスの実行が終了するまで待ってから、シェルスクリプトの次の命令に進むにはどうすればよいですか?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 に答える