Skip to content

Instantly share code, notes, and snippets.

@langsharpe
Created June 14, 2016 07:54
Show Gist options
  • Save langsharpe/6d6e194c4c378f1dc01a258b400a4be8 to your computer and use it in GitHub Desktop.
Save langsharpe/6d6e194c4c378f1dc01a258b400a4be8 to your computer and use it in GitHub Desktop.
Bash options
set -e # Exit immediately if a command exits with a non-zero status
set -u # Exit immediately if an undefined variable is used (e.g. echo "$UNDEFINED_ENV_VAR")
set -o pipefail # Ensures pipelines (e.g. cmd | othercmd) return a non-zero status if a command fails
set -x # Print each expanded command before executing (useful for debugging)
# Source: https://buildkite.com/docs/guides/writing-build-scripts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment