Skip to content

Instantly share code, notes, and snippets.

@Graham42
Graham42 / retry.sh
Last active September 26, 2018 14:51 — forked from sj26/LICENSE.md
Bash retry function
# echo, but to stderr
function echoerr {
echo "$@" 1>&2;
}
# Retry a command up to a specific numer of times until it exits successfully,
# with exponential back off.
#
# $ retry 5 echo Hello
# Hello
#
#!/bin/bash
function usage {
echo "USAGE: git merge-svn <from> [<to>]"
echo ""
echo " from The branch name to be merged FROM"
echo " to Optional branch name to be merged onto. Default: HEAD"
echo ""
}