Skip to content

Instantly share code, notes, and snippets.

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