Skip to content

Instantly share code, notes, and snippets.

@darrend
Created October 28, 2015 17:35
Show Gist options
  • Save darrend/3479e70eaa680b9ae10e to your computer and use it in GitHub Desktop.
Save darrend/3479e70eaa680b9ae10e to your computer and use it in GitHub Desktop.
bash tricks
yell() { echo "$0: $*" >&2; }
die() { yell "$*"; exit 111; }
try() { "$@" || die "cannot $*"; }
scriptdir() { (cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment