From: Martin Mares Date: Sun, 3 Feb 2008 22:38:22 +0000 (+0100) Subject: Decreased the amount of shell magic in override-vars. X-Git-Tag: python-dummy-working~243 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=99653cd8d766cabaed2b1f2628e0b041fc0837c8;p=eval.git Decreased the amount of shell magic in override-vars. --- diff --git a/bin/lib b/bin/lib index 981b010..2e9ed7e 100644 --- a/bin/lib +++ b/bin/lib @@ -53,14 +53,13 @@ function try-ln function override-vars { - local OR V OLDIFS + local OR V W declare -a OR - OLDIFS="$IFS" - IFS=$'\n' - OR=($(set | sed "s/^$1_//;t;d")) || true - IFS="$OLDIFS" + # `${!${1}_@}' does not work, so we have to use eval + OR=($(eval echo '${!'$1'_@}')) for V in "${OR[@]}" ; do - eval "$V" + W=${V##$1_} + eval $W='"$'$V'"' done }