From 6ef4f37add2d054cb4d8e448c56fcd9c2cf77bc5 Mon Sep 17 00:00:00 2001 From: Riccardo Schirone Date: Mon, 22 Feb 2016 09:41:50 +0100 Subject: [PATCH] env.sh: fix var substitution issue the issue was when using a number of parameter greater than 9. For example, to evaluate the 10th param, the substution was $10, but this was interpreted as $1 + 0, so the issue radare20. Using ${10} should fix the issue. --- env.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/env.sh b/env.sh index d352263bbf444..ce50ff7c863f5 100755 --- a/env.sh +++ b/env.sh @@ -47,17 +47,16 @@ if [ -z "$*" ]; then echo "==> Back to system shell..." echo else - s='$' if [ "$#" -gt 1 ]; then par="" p=0 while : ; do p=$(($p+1)) [ $p -gt $# ] && break - a=`eval echo "$s$p"` + a=`eval echo "\$\{$p\}"` par="$par$a " done - eval $new_env $par "\"\$$#\"" + eval $new_env $par "\"\${$#}\"" else eval $new_env $* fi