Results for redirect.test.sh

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

stdout:
stderr: 
dash: 2: Syntax error: Bad fd number
bash12 Descriptor redirect with filename

stdout:
status=0
stderr:
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/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:
osh_ALT34 >| to clobber

[osh_ALT 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-6769.txt'.  Expected D, -, or D- where D is an integer
grep: osh-6769.txt: No such file or directory
grep: osh-6769.txt: No such file or directory
osh_ALT36 >&word redirects stdout and stderr when word is not a number or -

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

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

stdout:
stderr: 
mksh: <stdin>[18]: 6>&7- : illegal file descriptor name
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:
osh_ALT50 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: