From 9d617c44d2b1135d14b7dafd01a1d3992293f4d9 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 9 Jun 2009 18:40:52 +0200 Subject: 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 --- shell/hush_test/hush-bugs/export_exp.right | 7 +++++++ shell/hush_test/hush-bugs/export_exp.tests | 19 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 shell/hush_test/hush-bugs/export_exp.right create mode 100755 shell/hush_test/hush-bugs/export_exp.tests (limited to 'shell/hush_test/hush-bugs') 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 @@ +aa0 bb0 +a=aa0 b=bb0 +aa1 bb1 +a=aa1 b=bb1 +zzz=zzz +zz=* +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 @@ +v="a=aa0 b=bb0" +# only 1st arg should be expanded in multiple words +export $v c=$v +echo $a $b +echo $c + +# only 1st arg should be expanded in multiple words +export `echo a=aa1 b=bb1` c=`echo a=aa1 b=bb1` +echo $a $b +echo $c + +>zz=zz +>zzz=zzz +# only 1st arg should be globbed +export zzz* zz=* +env | grep ^zz | sort +rm -rf zz=zz zzz=zzz + +echo Done -- cgit v1.2.3