Skip to content

Instantly share code, notes, and snippets.

@np
Last active October 10, 2015 19:07
Show Gist options
  • Save np/3736727 to your computer and use it in GitHub Desktop.
Save np/3736727 to your computer and use it in GitHub Desktop.
Simple 'error' function in shell
# error() @ https://gist.github.com/np/3736727#file-error-sh {{{
# Takes an exit code and a message, prints the message and then exits
error(){
local code="$1"
shift
echo "error: $@" >>/dev/stderr
exit "$code"
}
# }}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment