Results for redirect.test.sh

statusoshosh-cpp
pass 5352
ok 11
FAIL 23
total5656
caseoshosh-cppdescription
0pass pass >&
1pass pass <&
2pass pass Leading redirect
3pass pass Nonexistent file
4pass pass Redirect in command sub
5pass pass Redirect in assignment
6pass pass Redirect in function body.
7pass pass Bad redirects in function body
8pass pass Redirect in function body is evaluated multiple times
9pass pass Redirect in function body AND function call
10pass pass Descriptor redirect with spaces
11pass pass Filename redirect with spaces
12pass pass Quoted filename redirect with spaces
13pass pass Descriptor redirect with filename
14pass pass redirect for loop
15pass pass redirect subshell
16pass pass Prefix redirect for loop -- not allowed
17pass pass Brace group redirect
18pass pass Redirect echo to stderr, and then redirect all of stdout somewhere.
19pass pass Redirect in the middle of two assignments
20pass pass Redirect in the middle of a command
21pass pass Named file descriptor
22pass pass Double digit fd (20> file)
23pass pass : 9> fdleak (OSH regression)
24pass pass : 3>&3 (OSH regression)
25pass pass : 3>&3-
26pass pass 3>&- << EOF (OSH regression: fail to restore fds)
27pass pass Open file on descriptor 3 and write to it many times
28pass pass Open file on descriptor 4 and write to it many times
29pass pass Redirect function stdout
30pass pass Nested function stdout redirect
31pass pass Redirect to empty string
32pass pass Redirect to file descriptor that's not open
33pass pass Open descriptor with exec
34pass pass Open multiple descriptors with exec
35FAIL FAIL >| to clobber
detailsdetails
36pass pass &> redirects stdout and stderr
37FAIL FAIL >&word redirects stdout and stderr when word is not a number or -
detailsdetails
38pass pass 1>&- to close file descriptor
39pass pass 1>&2- to move file descriptor
40pass FAIL 1>&2- (Bash bug: fail to restore closed fd)
details
41pass pass <> for read/write
42pass pass <> for read/write named pipes
43pass pass &>> appends stdout and stderr
44pass pass exec redirect then various builtins
45pass pass >$file touches a file
46pass pass $(< $file) yields the contents of the file
47pass pass $(< file) with more statements
48pass pass < file in pipeline and subshell doesn't work
49pass pass 2>&1 with no command
50pass pass 2&>1 (is it a redirect or is it like a&>1)
51ok ok can't mention big file descriptor
detailsdetails
52pass pass : >/dev/null 2> / (OSH regression: fail to pop fd frame)
53pass pass echo foo >&100 (OSH regression: does not fail with invalid fd 100)
54pass pass echo foo >&N where N is first unused fd
55pass pass exec {fd}>&- (OSH regression: fails to close fd)
105 passed, 2 OK, 0 not implemented, 0 BUG, 5 failed, 0 timeouts, 0 cases skipped
2 failed under osh

Details on runs that didn't PASS

osh35 >| to clobber

[osh stdout] Expected 'status=1\nXX\nZZ\n', got 'status=0\nYY\nZZ\n'

stdout:
status=0
YY
ZZ
stderr:
osh-cpp35 >| to clobber

[osh-cpp stdout] Expected 'status=1\nXX\nZZ\n', got 'status=0\nYY\nZZ\n'

stdout:
status=0
YY
ZZ
stderr:
osh37 >&word redirects stdout and stderr when word is not a number or -

[osh stdout] Expected 'STDOUT\nSTDERR\n', got ''
[osh status] Expected 0, got 2

stdout:
stderr: 
  stdout_stderr.py >&$tmp
                     ^~~~
[ stdin ]:5: Invalid descriptor 'osh-31585.txt'.  Expected D, -, or D- where D is an integer
grep: osh-31585.txt: No such file or directory
grep: osh-31585.txt: No such file or directory
osh-cpp37 >&word redirects stdout and stderr when word is not a number or -

[osh-cpp stdout] Expected 'STDOUT\nSTDERR\n', got ''
[osh-cpp status] Expected 0, got 2

stdout:
stderr: 
  stdout_stderr.py >&$tmp
                     ^~~~
[ stdin ]:5: Invalid descriptor 'osh-31656.txt'.  Expected D, -, or D- where D is an integer
grep: osh-31656.txt: No such file or directory
grep: osh-31656.txt: No such file or directory
osh-cpp40 1>&2- (Bash bug: fail to restore closed fd)

[osh-cpp status] Expected 2, got -6

stdout:
stderr: 
Error closing descriptor 6: Bad file descriptor
terminate called after throwing an instance of 'OSError*'
timeout: the monitored command dumped core
osh51 can't mention big file descriptor

stdout:
hi
hi
hi 100
stderr:
osh-cpp51 can't mention big file descriptor

stdout:
hi
hi
hi 100
stderr: