Created
October 27, 2016 10:22
-
-
Save jupemara/e86719f049f3336a5cd3e2b37d3fe259 to your computer and use it in GitHub Desktop.
某かをshell scriptでretryするやつ
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
#!/bin/sh | |
EXIT_CODE=1 | |
COUNTER=0 | |
MAX_RETRY=${1:-10} | |
until [ $EXIT_CODE -eq 0 ] || [ $COUNTER -gt $MAX_RETRY ]; do | |
COUNTER=`expr ${COUNTER} + 1` | |
# do something | |
EXIT_CODE=$? | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment