Results for redirect.test.sh

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

stdout:
status=2
stderr:
dash: 2: cannot create : Directory nonexistent
dash8 Redirect in function body is evaluated multiple times

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

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

stdout:
status=0
stderr:
mksh16 Prefix redirect for loop -- not allowed

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

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

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

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

stdout:
stderr: 
dash25 : 3>&3-

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

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

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

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

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

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

stdout:
status=0
YY
ZZ
stderr:
osh_ALT35 >| to clobber

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

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

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

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

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

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

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

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

stdout:
stderr: 
mksh: <stdin>[18]: 6>&7- : illegal file descriptor name
dash43 &>> appends stdout and stderr

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

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

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

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

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

stdout:
hi
hi
hi 100
stderr:
osh_ALT51 can't mention big file descriptor

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

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

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

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

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

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

stdout:
stderr: