Skip to content

Instantly share code, notes, and snippets.

@collinvandyck
Created September 4, 2014 17:18
Show Gist options
  • Select an option

  • Save collinvandyck/fbb052002f490e7d93aa to your computer and use it in GitHub Desktop.

Select an option

Save collinvandyck/fbb052002f490e7d93aa to your computer and use it in GitHub Desktop.
repeat some task until it has a non-zero exit
#!/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