Created
April 2, 2014 15:37
-
-
Save jwliechty/9936616 to your computer and use it in GitHub Desktop.
run_until_fails.sh
This file contains 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
runUntilFails(){ | |
local cmd="${1:?"Must give a command as a string"}" | |
local count=0 | |
echo "Running cmd: ${cmd}" | |
while eval "${cmd} ; return $?"; do | |
((count+=1)) | |
echo "Try count: ${count}" | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment