简体   繁体   English

如何在 bash 中等待结果?

[英]How to wait in bash for a result?

I would like to write a script that first calls supervisorctl reload then it runs and runs again supervisorctl status until it returns a zero exit code.我想编写一个脚本,首先调用supervisorctl reload然后它运行并再次运行supervisorctl status直到它返回零退出代码。

What is the proper way of doing that?这样做的正确方法是什么?

# first calls supervisorctl reload
supervisorctl reload
# runs again supervisorctl status until it does not return a non-zero exit code.
while ! supervisorctl status; do
   :
done

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM