testprogs: Correctly expand shell parameters
authorAndreas Schneider <asn@samba.org>
Mon, 13 Mar 2017 16:30:37 +0000 (17:30 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 15 Mar 2017 04:26:17 +0000 (05:26 +0100)
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 <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Mar 15 05:26:17 CET 2017 on sn-devel-144

testprogs/blackbox/subunit.sh

index 0791d775d275892d6dbec2adc1def06a073d8f7e..5c81ce20a118f45cd6a5db7b5a775257666baf05 100755 (executable)
@@ -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=$?