Skip to content

Instantly share code, notes, and snippets.

@tundeaoni
Last active February 17, 2017 11:03
Show Gist options
  • Save tundeaoni/7ff71ca30be6c4cb671913fc9dce271e to your computer and use it in GitHub Desktop.
Save tundeaoni/7ff71ca30be6c4cb671913fc9dce271e to your computer and use it in GitHub Desktop.
tiny bash script to retry task until it returns exit code 0
# !/bin/bash
readonly TIME_OUT=1
STATUS=1
printf "Command: %s \n" $@
#pass command
while [ "$STATUS" -ne 0 ]
do
"$@"
STATUS=$?
sleep $TIME_OUT
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment