This is a starter / template for writing Bash scripts. It includes a few things:
- some Doxygen-style comments to start things off
- flags to protect us from undefined variables and failed commands
- a
SCRIPT_PATH
variable so we can reference where the script lives - an error trap that prints the line where an error happens
- a stack dump when errors do happen
- a wrapper to allow us to source this script as if it was a library
- CLI parameter handling
- automagic help / usage generation
The goal is to help write scripts that are safer, cleaner, more usable, more testable, and easier to debug.