Created
September 4, 2014 17:18
-
-
Save collinvandyck/fbb052002f490e7d93aa to your computer and use it in GitHub Desktop.
repeat some task until it has a non-zero exit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| while :; do | |
| run_something # we want to run this thing until it fails | |
| if [[ "$?" -ne "0" ]] | |
| then | |
| # we detected a failure, quit | |
| exit | |
| fi | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment