-
-
Save trailjeep/8bc4711474c2ad3c5a7f62befb5df3d3 to your computer and use it in GitHub Desktop.
Simple Bash script template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Script name -- purpose | |
# | |
# Author: | |
set -o errexit # abort on nonzero exitstatus | |
set -o nounset # abort on unbound variable | |
# | |
# Functions | |
# | |
usage() { | |
cat << _EOF_ | |
Usage: ${0} | |
_EOF_ | |
} | |
# | |
# Variables | |
# | |
# | |
# Command line parsing | |
# | |
if [ "$#" -ne "1" ]; then | |
echo "Expected 1 argument, got $#" >&2 | |
usage | |
exit 2 | |
fi | |
# | |
# Script proper | |
# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment