Replace eval with variable indirection.

This commit is contained in:
Ceda EI 2019-09-06 18:05:12 +05:30
parent d9e86e4421
commit 2c6c83b826
1 changed files with 5 additions and 5 deletions

10
wish.sh
View File

@ -83,17 +83,17 @@ function wish_main() {
if wish_${WISH_PLUGINS[$(($i + 1))]}_start $prev; then if wish_${WISH_PLUGINS[$(($i + 1))]}_start $prev; then
local plugin=${WISH_PLUGINS[$i]} local plugin=${WISH_PLUGINS[$i]}
local next_plugin=${WISH_PLUGINS[$(($i+1))]} local next_plugin=${WISH_PLUGINS[$(($i+1))]}
local fg=$(eval echo \$WISH_$(echo $plugin | local fg_name=$(echo WISH_$(echo $plugin |
tr '[:lower:]' '[:upper:]')_BG) tr '[:lower:]' '[:upper:]')_BG)
local bg=$(eval echo \$WISH_$(echo $next_plugin | local bg_name=$(echo WISH_$(echo $next_plugin |
tr '[:lower:]' '[:upper:]')_BG) tr '[:lower:]' '[:upper:]')_BG)
wish_append $bg $fg wish_append ${!bg_name} ${!fg_name}
fi fi
else else
local plugin=${WISH_PLUGINS[$i]} local plugin=${WISH_PLUGINS[$i]}
local fg=$(eval echo \$WISH_$(echo $plugin | local fg_name=$(echo WISH_$(echo $plugin |
tr '[:lower:]' '[:upper:]')_BG) tr '[:lower:]' '[:upper:]')_BG)
wish_append -1 $fg wish_append -1 ${!fg_name}
fi fi
fi fi
fi fi