-
-
Save koutoftimer/bdef8e74e0a1a9c35d33c6e9866b1999 to your computer and use it in GitHub Desktop.
Bash Die Function
This file contains hidden or 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
function die () { | |
local message=$1 | |
[ -z "$message" ] && message="Died" | |
echo "$message (at ${BASH_SOURCE[1]}:${FUNCNAME[1]} line ${BASH_LINENO[0]}.)" >&2 | |
exit 1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment