Skip to content

Instantly share code, notes, and snippets.

@kevinkngo
kevinkngo / retry.sh
Last active February 18, 2023 21:06 — forked from sj26/LICENSE.md
Bash retry function
# Retry a command up to a specific numer of times until it exits successfully,
# with exponential back off.
#
# $ retry 5 echo Hello
# Hello
#
# $ retry 5 false
# Retry 1/5 exited 1, retrying in 1 seconds...
# Retry 2/5 exited 1, retrying in 2 seconds...
# Retry 3/5 exited 1, retrying in 4 seconds...

Keybase proof

I hereby claim:

  • I am kevinkngo on github.
  • I am kevinkngo (https://keybase.io/kevinkngo) on keybase.
  • I have a public key whose fingerprint is 1B86 D0B1 C1CD 3926 02FC C816 8F6B 47C3 AD74 6058

To claim this, I am signing this object: