Results for redirect.test.sh

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

Details on runs that didn't PASS

dash3 Nonexistent file

stdout:
status=2
stderr:
dash: 1: cannot open /home/andy/git/oilshell/oil/_tmp/spec-tmp/redirect.test.sh.22048/03-dash/nonexistent.txt: No such file
bash5 Redirect in assignment

stdout:
FILE=
FOO=
stderr:
foo
dash7 Redirect in function body is evaluated multiple times

stdout:
stderr: 
dash: 2: arithmetic expression: expecting primary: "i++"
bash12 Descriptor redirect with filename

stdout:
status=0
stderr:
dash12 Descriptor redirect with filename

stdout:
stderr: 
dash: 2: Syntax error: Bad fd number
mksh15 Prefix redirect for loop -- not allowed

stdout:
stderr: 
mksh: <stdin>[1]: for: not found
mksh: <stdin>[2]: syntax error: 'do' unexpected
dash20 Named file descriptor

stdout:
stderr: 
dash: 1: exec: {myfd}: not found
mksh20 Named file descriptor

stdout:
stderr: 
mksh: <stdin>[1]: {myfd}: not found
dash21 Double digit fd (20> file)

stdout:
stderr: 
dash: 1: exec: 20: not found
mksh23 : 3>&3 (OSH regression)

stdout:
stderr: 
dash24 : 3>&3-

stdout:
stderr: 
dash: 2: Syntax error: Bad fd number
mksh24 : 3>&3-

stdout:
stderr: 
mksh: <stdin>[1]: 3>&3- : illegal file descriptor name
dash30 Redirect to empty string

stdout:
result=2
stderr:
dash: 2: cannot create : Directory nonexistent
dash: 5: cannot create : Directory nonexistent
dash31 Redirect to file descriptor that's not open

stdout:
stderr: 
dash: 8: 7: Bad file descriptor
dash34 >| to clobber

stdout:
status=2
XX
ZZ
stderr:
dash: 5: cannot create /home/andy/git/oilshell/oil/_tmp/spec-tmp/redirect.test.sh.22048/34-dash/c.txt: File exists
osh34 >| to clobber

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

stdout:
status=0
YY
ZZ
stderr:
dash35 &> redirects stdout and stderr

stdout:
STDOUT
stderr:
STDERR
dash36 >&word redirects stdout and stderr when word is not a number or -

stdout:
stderr: 
mksh36 >&word redirects stdout and stderr when word is not a number or -

stdout:
stderr: 
osh36 >&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-22412.txt'.  Expected D, -, or D- where D is an integer
grep: osh-22412.txt: No such file or directory
grep: osh-22412.txt: No such file or directory
dash38 1>&2- to move file descriptor

stdout:
stderr: 
dash: 4: Syntax error: Bad fd number
mksh38 1>&2- to move file descriptor

stdout:
stderr: 
mksh: <stdin>[3]: 6>&5- : illegal file descriptor name
bash39 1>&2- (Bash bug: fail to restore closed fd)

stdout:
hello
stderr:
bash: line 19: 7: Bad file descriptor
dash39 1>&2- (Bash bug: fail to restore closed fd)

stdout:
stderr: 
dash: 19: Syntax error: Bad fd number
dash42 &>> appends stdout and stderr

stdout:
stderr: 
dash45 $(< $file) yields the contents of the file

stdout:
stderr: 
dash49 2&>1 (is it a redirect or is it like a&>1)

stdout:
status=0
stderr:
dash: 1: 2: not found
mksh49 2&>1 (is it a redirect or is it like a&>1)

stdout:
status=0
stderr:
bash50 can't mention big file descriptor

stdout:
hi
hi
hi
stderr:
osh50 can't mention big file descriptor

stdout:
hi
hi
hi 100
stderr:
dash51 : >/dev/null 2> / (OSH regression: fail to pop fd frame)

stdout:
stderr: 
dash: 1: cannot create /: Is a directory
mksh51 : >/dev/null 2> / (OSH regression: fail to pop fd frame)

stdout:
stderr: 
mksh: <stdin>[1]: can't create /: Is a directory
dash52 echo foo >&100 (OSH regression: does not fail with invalid fd 100)

stdout:
stderr: 
dash: 3: Syntax error: Bad fd number
dash53 echo foo >&N where N is first unused fd

stdout:
stderr: 
dash: 8: Syntax error: Bad function name
dash54 exec {fd}>&- (OSH regression: fails to close fd)

stdout:
stderr: 
mksh54 exec {fd}>&- (OSH regression: fails to close fd)

stdout:
stderr: