Skip to content

Instantly share code, notes, and snippets.

@brennanMKE
Created December 14, 2021 20:45
Show Gist options
  • Save brennanMKE/86ce2f0f26f806b97886da8b73698c3a to your computer and use it in GitHub Desktop.
Save brennanMKE/86ce2f0f26f806b97886da8b73698c3a to your computer and use it in GitHub Desktop.
Die Shell Function

Die Shell Function

This function simply writes to STDERR and exits with 1 which indicates to the caller there was an error.

die()
{
MESSAGE=$1
>&2 echo "${MESSAGE}" && exit 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment