Created
March 28, 2022 15:28
-
-
Save dillonstreator/d3b767e99abe818a236e7cd1f9e2c523 to your computer and use it in GitHub Desktop.
run command until successful with sleep
This file contains hidden or 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
dountil() { | |
s=${SLEEP:-1} | |
until eval $*; do echo "failed.. retrying in $s sec" && sleep $s; done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
SLEEP=.5 dountil "echo 'PING' | nc localhost 3310 | grep 'PONG'"