hush: add testsuite for "no globbing in redirection" rule.
simplify redirection habdling
This commit is contained in:
2
shell/hush_test/hush-glob/glob_redir.right
Normal file
2
shell/hush_test/hush-glob/glob_redir.right
Normal file
@@ -0,0 +1,2 @@
|
||||
z.tmp:
|
||||
?.tmp: TEST
|
9
shell/hush_test/hush-glob/glob_redir.tests
Executable file
9
shell/hush_test/hush-glob/glob_redir.tests
Executable file
@@ -0,0 +1,9 @@
|
||||
# Redirections are not globbed.
|
||||
# bash:
|
||||
# if run as "sh", they are not globbed, but
|
||||
# if run as "bash", they are!
|
||||
>z.tmp
|
||||
echo TEST >?.tmp
|
||||
echo 'z.tmp:' `cat 'z.tmp'`
|
||||
echo '?.tmp:' `cat '?.tmp'`
|
||||
rm 'z.tmp' '?.tmp'
|
23
shell/hush_test/hush-parsing/escape3.right
Normal file
23
shell/hush_test/hush-parsing/escape3.right
Normal file
@@ -0,0 +1,23 @@
|
||||
v: a \ b \\ c \\\ d \\\\ e
|
||||
v: a \ b \\ c \\\ d \\\\ e
|
||||
Unquoted:
|
||||
.a.
|
||||
.\.
|
||||
.b.
|
||||
.\\.
|
||||
.c.
|
||||
.\\\.
|
||||
.d.
|
||||
.\\\\.
|
||||
.e.
|
||||
Quoted:
|
||||
.a.
|
||||
.\.
|
||||
.b.
|
||||
.\\.
|
||||
.c.
|
||||
.\\\.
|
||||
.d.
|
||||
.\\\\.
|
||||
.e.
|
||||
done
|
8
shell/hush_test/hush-parsing/escape3.tests
Executable file
8
shell/hush_test/hush-parsing/escape3.tests
Executable file
@@ -0,0 +1,8 @@
|
||||
v='a \ b \\ c \\\ d \\\\ e'
|
||||
echo v: $v
|
||||
echo v: "$v"
|
||||
echo Unquoted:
|
||||
for a in $v; do echo .$a.; done
|
||||
echo Quoted:
|
||||
for a in $v; do echo ".$a."; done
|
||||
echo done
|
3
shell/hush_test/hush-parsing/redir_space.right
Normal file
3
shell/hush_test/hush-parsing/redir_space.right
Normal file
@@ -0,0 +1,3 @@
|
||||
z1.tmp: 1
|
||||
z2.tmp: 1
|
||||
"z1.tmp z2.tmp": TEST 0
|
6
shell/hush_test/hush-parsing/redir_space.tests
Executable file
6
shell/hush_test/hush-parsing/redir_space.tests
Executable file
@@ -0,0 +1,6 @@
|
||||
v='z1.tmp z2.tmp'
|
||||
echo TEST >$v
|
||||
echo 'z1.tmp:' `cat 'z1.tmp' 2>/dev/null; echo $?`
|
||||
echo 'z2.tmp:' `cat 'z2.tmp' 2>/dev/null; echo $?`
|
||||
echo '"z1.tmp z2.tmp":' `cat 'z1.tmp z2.tmp' 2>/dev/null; echo $?`
|
||||
rm z*.tmp
|
Reference in New Issue
Block a user