Skip to content

Instantly share code, notes, and snippets.

@agounaris
Created October 27, 2022 09:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agounaris/dddd91b2547118a56a547bcba283e89d to your computer and use it in GitHub Desktop.
Save agounaris/dddd91b2547118a56a547bcba283e89d to your computer and use it in GitHub Desktop.
sample bash
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
if [[ -n "${TRACE-}" ]]; 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
cd "$(dirname "$0")"
main() {
echo do awesome stuff
}
main "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment