diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-06-09 18:40:52 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-06-09 18:40:52 +0200 |
commit | 9d617c44d2b1135d14b7dafd01a1d3992293f4d9 (patch) | |
tree | a763d31365f18cb2bb984d252bc849f03c45625a /shell/hush_test | |
parent | 2634bf366b298a827d043566656f8696f4dc153c (diff) | |
download | busybox-w32-9d617c44d2b1135d14b7dafd01a1d3992293f4d9.tar.gz busybox-w32-9d617c44d2b1135d14b7dafd01a1d3992293f4d9.tar.bz2 busybox-w32-9d617c44d2b1135d14b7dafd01a1d3992293f4d9.zip |
hush: specially handle [[ - suppress globbing & multiword expansion
It's a bashism, but is surprisingly easy to do and costs very little code.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/hush_test')
-rw-r--r-- | shell/hush_test/hush-bugs/export_exp.right | 7 | ||||
-rwxr-xr-x | shell/hush_test/hush-bugs/export_exp.tests | 19 |
2 files changed, 26 insertions, 0 deletions
diff --git a/shell/hush_test/hush-bugs/export_exp.right b/shell/hush_test/hush-bugs/export_exp.right new file mode 100644 index 000000000..17a2e93f7 --- /dev/null +++ b/shell/hush_test/hush-bugs/export_exp.right | |||
@@ -0,0 +1,7 @@ | |||
1 | aa0 bb0 | ||
2 | a=aa0 b=bb0 | ||
3 | aa1 bb1 | ||
4 | a=aa1 b=bb1 | ||
5 | zzz=zzz | ||
6 | zz=* | ||
7 | Done | ||
diff --git a/shell/hush_test/hush-bugs/export_exp.tests b/shell/hush_test/hush-bugs/export_exp.tests new file mode 100755 index 000000000..91f57aa2c --- /dev/null +++ b/shell/hush_test/hush-bugs/export_exp.tests | |||
@@ -0,0 +1,19 @@ | |||
1 | v="a=aa0 b=bb0" | ||
2 | # only 1st arg should be expanded in multiple words | ||
3 | export $v c=$v | ||
4 | echo $a $b | ||
5 | echo $c | ||
6 | |||
7 | # only 1st arg should be expanded in multiple words | ||
8 | export `echo a=aa1 b=bb1` c=`echo a=aa1 b=bb1` | ||
9 | echo $a $b | ||
10 | echo $c | ||
11 | |||
12 | >zz=zz | ||
13 | >zzz=zzz | ||
14 | # only 1st arg should be globbed | ||
15 | export zzz* zz=* | ||
16 | env | grep ^zz | sort | ||
17 | rm -rf zz=zz zzz=zzz | ||
18 | |||
19 | echo Done | ||