From acd81f8c0fd50132f3ac3ff4fb304f48e13114aa Mon Sep 17 00:00:00 2001 From: "Fred T. Hamster" Date: Wed, 12 Feb 2014 15:00:11 -0500 Subject: [PATCH] added var function to print out variable values. --- scripts/core/functions.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 -- 2.34.1