Skip to content

Instantly share code, notes, and snippets.

@ffflorian
Created September 24, 2015 10:17
Show Gist options
  • Save ffflorian/dc25a8f631598a75278e to your computer and use it in GitHub Desktop.
Save ffflorian/dc25a8f631598a75278e to your computer and use it in GitHub Desktop.
Three-Fingered Claw
# taken from http://stackoverflow.com/questions/1378274/in-a-bash-script-how-can-i-exit-the-entire-script-if-a-certain-condition-occurs
yell() { echo "$0: $*" >&2; }
die() { yell "$*"; exit 111; }
try() { "$@" || die "cannot $*"; }
@ikenigma
Copy link

ikenigma commented Nov 6, 2015

Don't forget to 'exit 0' or 'true' at the end...
https://gist.github.com/dotike/8257326

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment