Created
November 16, 2019 03:03
-
-
Save alexanderankin/55d6f966a0568dc65eace94fb8635d02 to your computer and use it in GitHub Desktop.
Bash Die Function
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
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