Skip to content

Instantly share code, notes, and snippets.

@johnpena
Created October 27, 2022 18:34
Show Gist options
  • Save johnpena/b4affeeb3bebb26a4ef54e1a7a15b88f to your computer and use it in GitHub Desktop.
Save johnpena/b4affeeb3bebb26a4ef54e1a7a15b88f to your computer and use it in GitHub Desktop.
template.sh
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
if [[ "${TRACE-0}" == "1" ]]; then
set -o xtrace
fi
if [[ "${1-}" =~ ^-*h(elp)?$ ]]; then
echo 'Usage: ./script.sh arg-one arg-two
This is a longer description of the script.
'
exit
fi
cd "$(dirname "$0")"
main() {
echo 'hello, script'
}
# run the main function with all args
main "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment