Skip to content

Instantly share code, notes, and snippets.

@Segmentational
Created August 2, 2023 19:59
Show Gist options
  • Save Segmentational/14fa21a05da7ff684ac5d2964e038d68 to your computer and use it in GitHub Desktop.
Save Segmentational/14fa21a05da7ff684ac5d2964e038d68 to your computer and use it in GitHub Desktop.
Default Bash Template, Personal
#!/bin/bash --posix
# -*- Coding: UTF-8 -*- #
# -*- System: Linux -*- #
# -*- Usage: *.* -*- #
# Author: Jacob Sanders (GitHub - Segmentational)
# See Bash Set-Options Reference Below
set -euo pipefail # (0)
set -o xtrace # (6)
# --------------------------------------------------------------------------------
# Bash Set-Options Reference
# - https://tldp.org/LDP/abs/html/options.html
# --------------------------------------------------------------------------------
# 0. An Opinionated, Well Agreed Upon Standard for Bash Script Execution
# 1. set -o verbose ::: Print Shell Input upon Read
# 2. set -o allexport ::: Export all Variable(s) + Function(s) to Environment
# 3. set -o errexit ::: Exit Immediately upon Pipeline'd Failure
# 4. set -o monitor ::: Output Process-Separated Command(s)
# 5. set -o privileged ::: Ignore Externals - Ensures of Pristine Run Environment
# 6. set -o xtrace ::: Print a Trace of Simple Commands
# 7. set -o braceexpand ::: Enable Brace Expansion
# 8. set -o no-exec ::: Bash Syntax Debugging
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment