From: Fred T. Hamster Date: Thu, 13 Feb 2014 19:48:45 +0000 (-0500) Subject: made var function support multiple names. X-Git-Tag: 2.140.90~829 X-Git-Url: https://feistymeow.org/gitweb/?p=feisty_meow.git;a=commitdiff_plain;h=6b3e90f782c845f3b6d4ea7e9607c2f98de9b8ef made var function support multiple names. --- 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()