Skip to content

Instantly share code, notes, and snippets.

@koenighotze
Created November 7, 2022 08:45
Show Gist options
  • Save koenighotze/c91ba6bdffbfd737d7d77bfce01ea6ec to your computer and use it in GitHub Desktop.
Save koenighotze/c91ba6bdffbfd737d7d77bfce01ea6ec to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# when a command fails, bash exits instead of continuing with the rest of the script
set -o errexit
# make the script fail, when accessing an unset variable
set -o nounset
# pipeline command is treated as failed, even if one command in the pipeline fails
set -o pipefail
# enable debug mode, by running your script as TRACE=1
if [[ "${TRACE-0}" == "1" ]]; then set -o xtrace; fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment