From 6b3e90f782c845f3b6d4ea7e9607c2f98de9b8ef Mon Sep 17 00:00:00 2001 From: "Fred T. Hamster" Date: Thu, 13 Feb 2014 14:48:45 -0500 Subject: [PATCH] made var function support multiple names. --- scripts/core/functions.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/scripts/core/functions.sh b/scripts/core/functions.sh index bc2d1cab..41d94b93 100644 --- a/scripts/core/functions.sh +++ b/scripts/core/functions.sh @@ -35,12 +35,17 @@ if [ -z "$skip_all" ]; then # 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 + while true; do + local varname="$1"; shift + if [ -z "$varname" ]; then + break + fi + if [ -z "${!varname}" ]; then + echo "$varname undefined" + else + echo "$varname=${!varname}" + fi + done } function success_sound() -- 2.34.1