Last active
October 3, 2016 08:38
-
-
Save virtualmackem/a3d1350e6a1d31c695a0df7a07bae4e1 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
log() { echo $(date): $* ; } #logs date and message to stdout | |
die() { log $* 1>&2 ; usage ; exit 1 ; } #logs error message to stderr and exits | |
usage() { #logs usage info to stderr | |
cat <<EOF 1>&2 | |
Usage: $0 [OPTION]... | |
-a this option adds bunnies | |
EOF | |
} | |
log "We're going to doSomething" | |
doSomething || die "doSomething failed" | |
doSomethingElse || die "doSomethingElse failed" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment