projects
/
EVA-2020-02.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
feat(bkgpslog):Add yell, die, try functions
[EVA-2020-02.git]
/
exec
/
bkgpslog
diff --git
a/exec/bkgpslog
b/exec/bkgpslog
index 5cfa7cc266135c81654947f42840e4b75266037c..043dc05c5d766e272815d9dbd5659bd613a63f35 100755
(executable)
--- 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.
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.
echoerr() {
echo "$@" 1>&2; # Define stderr echo function.
} # Define stderr message function.