X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=bin%2Flib;h=2e9ed7edec8bce0578b3a33fda4e8c85dd834125;hb=99653cd8d766cabaed2b1f2628e0b041fc0837c8;hp=981b01002a93e3ae4544d19285786059732d5148;hpb=d9766570488d6407d3f348bab1a1ea7f9407a39b;p=moe.git 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 }