Skip to content

Instantly share code, notes, and snippets.

@olavocneto
Created November 2, 2022 15:37
Show Gist options
  • Save olavocneto/0e3e4bd9ba486ba4013681e4802e031e to your computer and use it in GitHub Desktop.
Save olavocneto/0e3e4bd9ba486ba4013681e4802e031e to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# https://sharats.me/posts/shell-script-best-practices/
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 an awesome bash script to make your life better.
'
exit
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment