From: Andreas Schneider Date: Mon, 13 Mar 2017 16:30:37 +0000 (+0100) Subject: testprogs: Correctly expand shell parameters X-Git-Tag: tdb-1.3.13~460 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=acad0adc2977ca26df44e5b22d8b8e991177af71;p=thirdparty%2Fsamba.git testprogs: Correctly expand shell parameters The old behaviour is: for var in $* do echo "$var" done And you get this: $ sh test.sh 1 2 '3 4' 1 2 3 4 Changing it to: for var in "$@" do echo "$var" done will correctly expand to: $ sh test.sh 1 2 '3 4' 1 2 3 4 Signed-off-by: Andreas Schneider Reviewed-by: Jeremy Allison Autobuild-User(master): Andreas Schneider Autobuild-Date(master): Wed Mar 15 05:26:17 CET 2017 on sn-devel-144 --- diff --git a/testprogs/blackbox/subunit.sh b/testprogs/blackbox/subunit.sh index 0791d775d27..5c81ce20a11 100755 --- a/testprogs/blackbox/subunit.sh +++ b/testprogs/blackbox/subunit.sh @@ -78,7 +78,7 @@ subunit_skip_test () { testit () { name="$1" shift - cmdline="$*" + cmdline="$@" subunit_start_test "$name" output=`$cmdline 2>&1` status=$? @@ -93,7 +93,7 @@ testit () { testit_expect_failure () { name="$1" shift - cmdline="$*" + cmdline="$@" subunit_start_test "$name" output=`$cmdline 2>&1` status=$?