Skip to content

Instantly share code, notes, and snippets.

@jwliechty
Created April 2, 2014 15:37
Show Gist options
  • Save jwliechty/9936616 to your computer and use it in GitHub Desktop.
Save jwliechty/9936616 to your computer and use it in GitHub Desktop.
run_until_fails.sh
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