Last active
October 10, 2015 19:07
-
-
Save np/3736727 to your computer and use it in GitHub Desktop.
Simple 'error' function in shell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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