X-Git-Url: https://zdv2.bktei.com/gitweb/BK-2020-03.git/blobdiff_plain/c3c5720e1e742e389fdfab3091b3c397e98ddade..849106f7246e47bc077d7f3b8228cec717a8e63d:/unitproc/bktemp-yellDieTry?ds=sidebyside diff --git a/unitproc/bktemp-yellDieTry b/unitproc/bktemp-yellDieTry deleted file mode 100644 index fafa168..0000000 --- a/unitproc/bktemp-yellDieTry +++ /dev/null @@ -1,23 +0,0 @@ -#!/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==