Home > other >  How to wait in bash for a result?
How to wait in bash for a result?

Time:07-09

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.

What is the proper way of doing that?

CodePudding user response:

# 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
  •  Tags:  
  • bash
  • Related