hush: fix expansion of quoted $VAR, $* and $@

This commit is contained in:
Denis Vlasenko
2007-05-16 10:39:24 +00:00
parent 8f6bdb42df
commit 1f4cf517f5
9 changed files with 51 additions and 27 deletions

View File

@@ -1,8 +1,3 @@
Testing: in $empty""
..
Testing: in "$*"
.abc d e.
Testing: in "$@"
.abc.
.d e.
Finished

View File

@@ -5,8 +5,4 @@ fi
echo 'Testing: in $empty""'
empty=''
for a in $empty""; do echo ".$a."; done
echo 'Testing: in "$*"'
for a in "$*"; do echo ".$a."; done
echo 'Testing: in "$@"'
for a in "$@"; do echo ".$a."; done
echo Finished

View File

@@ -1 +0,0 @@
.1 abc d e f.

View File

@@ -1,4 +0,0 @@
if test $# = 0; then
exec "$THIS_SH" starquoted.tests 1 abc 'd e f'
fi
for a in "$*"; do echo ".$a."; done

View File

@@ -0,0 +1 @@
a b

View File

@@ -0,0 +1,2 @@
a_b='a b'
echo "$a_b"

View File

@@ -0,0 +1,8 @@
.1 abc d e f.
.1.
.abc.
.d e f.
.-1 abc d e f-.
.-1.
.abc.
.d e f-.

View File

@@ -0,0 +1,8 @@
if test $# = 0; then
exec "$THIS_SH" "$0" 1 abc 'd e f'
fi
for a in "$*"; do echo ".$a."; done
for a in "$@"; do echo ".$a."; done
for a in "-$*-"; do echo ".$a."; done
for a in "-$@-"; do echo ".$a."; done