Skip to content

Instantly share code, notes, and snippets.

@jupemara
Created October 27, 2016 10:22
Show Gist options
  • Save jupemara/e86719f049f3336a5cd3e2b37d3fe259 to your computer and use it in GitHub Desktop.
Save jupemara/e86719f049f3336a5cd3e2b37d3fe259 to your computer and use it in GitHub Desktop.
某かをshell scriptでretryするやつ
#!/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