From: Steven Baltakatei Sandoval Date: Sun, 28 Jun 2020 16:50:50 +0000 (+0000) Subject: feat(bkgpslog):Add yell, die, try functions X-Git-Url: https://zdv2.bktei.com/gitweb/EVA-2020-02.git/commitdiff_plain/c609b9c8d377902faa6a979eea643b239e3e4a62?ds=inline feat(bkgpslog):Add yell, die, try functions --- diff --git a/exec/bkgpslog b/exec/bkgpslog index 5cfa7cc..043dc05 100755 --- a/exec/bkgpslog +++ b/exec/bkgpslog @@ -13,7 +13,13 @@ SCRIPT_TIME_SHORT="$(date +%Y%m%dT%H%M%S%z)" # Save current date & time in ISO-8 SCRIPT_DATE_SHORT="$(date +%Y%m%d)" # Save current date in ISO-8601 format. #DIROUT1="/home/pi/Sync/Evanescent_Location" # Define output directory. -#== Function Definitions == +#== Script Function Definitions == +# Yell, Die, Try Three-Fingered Claw technique +# Ref/Attrib: https://stackoverflow.com/a/25515370 +yell() { echo "$0: $*" >&2; } +die() { yell "$*"; exit 111; } +try() { "$@" || die "cannot $*"; } + echoerr() { echo "$@" 1>&2; # Define stderr echo function. } # Define stderr message function.