Bash script template
14 December 2025 (Updated 18 December 2025)
#!/usr/bin/env bash
#
# <Describe what this script does>
# Turn on strict mode
# -e Exit the script if any command returns with a non-zero status code
# -u Treat use of undefined variables as an error
# -o Consider a pipeline failed if any of its commands fail not just the last one
set -euo pipefail
echo "TODO"
# Explicitly specify an exit code otherwise the exit code of the last executed
# command will be used as the exit code which may not be what you want.
exit 0
Tagged:
Bash