hush: fix a few more corner cases with empty-expanding cmds
See added testcases function old new delta run_pipe 1723 1784 +61 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
1
shell/hush_test/hush-psubst/falsetick2.right
Normal file
1
shell/hush_test/hush-psubst/falsetick2.right
Normal file
@@ -0,0 +1 @@
|
||||
Two:2 v:[]
|
||||
3
shell/hush_test/hush-psubst/falsetick2.tests
Executable file
3
shell/hush_test/hush-psubst/falsetick2.tests
Executable file
@@ -0,0 +1,3 @@
|
||||
v=v
|
||||
v=`exit 2` `false`
|
||||
echo Two:$? v:"[$v]"
|
||||
11
shell/hush_test/hush-redir/redir_backquote1.right
Normal file
11
shell/hush_test/hush-redir/redir_backquote1.right
Normal file
@@ -0,0 +1,11 @@
|
||||
hush: can't open '/cant/be/created': No such file or directory
|
||||
First
|
||||
One:1 v1:[]
|
||||
hush: can't open '/cant/be/created': No such file or directory
|
||||
Second
|
||||
One:1 v2:[]
|
||||
Third
|
||||
Zero:0 v3:[]
|
||||
Fourth
|
||||
Zero:0 v4:[]
|
||||
Zero:0 v5:[1]
|
||||
19
shell/hush_test/hush-redir/redir_backquote1.tests
Executable file
19
shell/hush_test/hush-redir/redir_backquote1.tests
Executable file
@@ -0,0 +1,19 @@
|
||||
v=v
|
||||
v=`echo First >&2` `` >/cant/be/created
|
||||
echo One:$? v1:"[$v]"
|
||||
|
||||
v=v
|
||||
v=`echo Second >&2` `true` >/cant/be/created
|
||||
echo One:$? v2:"[$v]"
|
||||
|
||||
v=v
|
||||
v=`echo Third >&2` `true` 2>/dev/null
|
||||
echo Zero:$? v3:"[$v]"
|
||||
|
||||
v=v
|
||||
v=`echo Fourth >&2` `false` 2>/dev/null
|
||||
echo Zero:$? v4:"[$v]"
|
||||
|
||||
v=v
|
||||
v=`echo $?` `false` 2>/dev/null
|
||||
echo Zero:$? v5:"[$v]"
|
||||
Reference in New Issue
Block a user