From: Fred T. Hamster Date: Wed, 12 Feb 2014 20:00:11 +0000 (-0500) Subject: added var function to print out variable values. X-Git-Tag: 2.140.90~830 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=acd81f8c0fd50132f3ac3ff4fb304f48e13114aa;p=feisty_meow.git added var function to print out variable values. --- diff --git a/scripts/core/functions.sh b/scripts/core/functions.sh index 6d2bbe29..bc2d1cab 100644 --- a/scripts/core/functions.sh +++ b/scripts/core/functions.sh @@ -33,6 +33,16 @@ if [ -z "$skip_all" ]; then cd "$1" } + # displays the value of a variable in bash friendly format. + function var() { + local varname="$1"; shift + if [ -z "${!varname}" ]; then + echo "$varname undefined" + else + echo "$varname=${!varname}" + fi + } + function success_sound() { if [ ! -z "$CLAM_FINISH_SOUND" ]; then