From: Steven Baltakatei Sandoval Date: Sat, 17 Jul 2021 00:11:20 +0000 (+0000) Subject: chore(bktemp-yellDieTry):Add version, comments X-Git-Tag: 0.5.0~55 X-Git-Url: https://zdv2.bktei.com/gitweb/BK-2020-03.git/commitdiff_plain/831b1cb47a6a24ef8b0e56928ad1422c061d74a2?ds=inline;hp=-c chore(bktemp-yellDieTry):Add version, comments --- 831b1cb47a6a24ef8b0e56928ad1422c061d74a2 diff --git a/unitproc/bktemp-yellDieTry b/unitproc/bktemp-yellDieTry index 4295aff..fafa168 100644 --- a/unitproc/bktemp-yellDieTry +++ b/unitproc/bktemp-yellDieTry @@ -1,16 +1,18 @@ #!/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; } -die() { yell "$*"; exit 111; } -try() { "$@" || die "cannot $*"; } +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==