Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env sh
usage() {
cat <<-EOM
USAGE: `basename $0` <max_retries> <command> [<param1> [<param2> [...] ] ]
Retry shell commands until they work or max retries has been reached.
Helpful in a long running automation pipeline where a single non-zero
return status can waste a lot of time.

Keybase proof

I hereby claim:

  • I am erkolson on github.
  • I am erkolson (https://keybase.io/erkolson) on keybase.
  • I have a public key whose fingerprint is E433 F8B5 952D E6D4 C977 EEE3 4BBC A4E6 C95C 3247

To claim this, I am signing this object: