Skip to content

Instantly share code, notes, and snippets.

@bertvv
Last active February 1, 2019 19:20
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bertvv/7727082 to your computer and use it in GitHub Desktop.
Save bertvv/7727082 to your computer and use it in GitHub Desktop.
Simple Bash script template
#!/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
#
@AhmadAlhajKarim
Copy link

Waarom moeten wij in line 30 de stdout dwingen naar stderr ? Heeft het echt nut?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment