Last active
May 27, 2016 15:38
-
-
Save stefco/78e6c66ac9fffbb5757624300c2b3766 to your computer and use it in GitHub Desktop.
The Three Fingered Claw
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/sh | |
# good for error-logging and mixing safe/unsafe execution | |
LOGFILE=/dev/stderr # default | |
log() { echo "$(date +'%D %H:%M:%S:') $*" >> "$LOGFILE"; } | |
die() { log "$*"; exit 111; } | |
try() { "$@" || die "Invalid: $*"; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment