From: Steven Baltakatei Sandoval Date: Sat, 17 Jul 2021 00:14:44 +0000 (+0000) Subject: Merge tag '0.4.7' X-Git-Tag: 0.5.0~54 X-Git-Url: https://zdv2.bktei.com/gitweb/BK-2020-03.git/commitdiff_plain/d3bd7fe1b1d9acdb89655d532e9243ee4addcdd3?hp=2928a8e40d1950022451aad8fa94c668febad98b Merge tag '0.4.7' feat(unitproc):create bktemp-processArgs # gpg: Signature made Tue 13 Jul 2021 10:15:43 PM GMT # gpg: using RSA key 38F96437C83AC88E28B7A95257DA57D9517E6F86 # gpg: Good signature from "Steven Sandoval " [ultimate] # gpg: aka "Steven Sandoval " [ultimate] # Primary key fingerprint: 3457 A265 922A 1F38 39DB 0264 A0A2 95AB DC34 69C9 # Subkey fingerprint: 38F9 6437 C83A C88E 28B7 A952 57DA 57D9 517E 6F86 --- diff --git a/unitproc/bktemp-yellDieTry b/unitproc/bktemp-yellDieTry new file mode 100644 index 0000000..fafa168 --- /dev/null +++ b/unitproc/bktemp-yellDieTry @@ -0,0 +1,23 @@ +#!/bin/bash +# Desc: Defines bash functions yell(), die(), and try(), which are useful for +# indicating where in a script an error occurs. +# Note: All three functions should be added together if used at all. +# Ref/Attrib: [1] Yell, Die, Try Three-Fingered Claw technique https://stackoverflow.com/a/25515370 +# Depends: GNU Coreutils 8.30 +# Version 0.1.1 + +#==BEGIN Define script parameters== +#==END Define script parameters== + +#===BEGIN Declare local script functions=== +yell() { echo "$0: $*" >&2; } # print script path and all args to stderr +die() { yell "$*"; exit 111; } # same as yell() but non-zero exit status +try() { "$@" || die "cannot $*"; } # runs args as command, reports args if command fails +#===END Declare local script functions=== + +#==BEGIN sample code== +yell "This message should appear in stderr."; +try echo "This message should appear in stdout."; +try eeeecho "This message should appear in an error message in stderr."; +yell "This message should not appear because \"try eeeecho\" failed."; +#==END sample code==