gpt4 book ai didi

Shell 脚本等待进程完成

转载 作者:行者123 更新时间:2023-12-01 07:42:22 25 4
gpt4 key购买 nike

我有一个流程

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

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com