Skip to content

Instantly share code, notes, and snippets.

@koutoftimer
Forked from alexanderankin/die.sh
Created March 27, 2024 13:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koutoftimer/bdef8e74e0a1a9c35d33c6e9866b1999 to your computer and use it in GitHub Desktop.
Save koutoftimer/bdef8e74e0a1a9c35d33c6e9866b1999 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