Results for redirect.test.sh

statusbashmkshkshtoyshsushbrushosh
pass 34292918222635
ok 0200001
N-I 0500000
BUG 3100000
FAIL 0081915101
TIME 0000010
total37373737373737
casebashmkshkshtoyshsushbrushoshdescription
0pass pass pass pass pass pass pass >& and <& are the same
1pass pass pass FAIL pass pass pass <&
details
2pass pass pass pass pass pass pass 2>&1 with no command
3pass ok FAIL FAIL FAIL pass pass 2&>1 (is it a redirect or is it like a&>1)
detailsdetailsdetailsdetails
4pass pass pass pass pass pass pass Nonexistent file
5pass pass pass pass pass pass pass Descriptor redirect with spaces
6pass pass pass pass pass pass pass Filename redirect with spaces
7pass pass pass pass pass pass pass Quoted filename redirect with spaces
8BUG pass pass FAIL pass FAIL pass Descriptor redirect with filename
detailsdetailsdetails
9pass pass pass pass pass pass pass Redirect echo to stderr, and then redirect all of stdout somewhere.
10pass N-I FAIL pass FAIL FAIL pass Named file descriptor
detailsdetailsdetailsdetails
11pass pass FAIL pass pass pass pass Double digit fd (20> file)
details
12pass pass pass FAIL pass pass pass : 9> fdleak (OSH regression)
details
13pass BUG pass FAIL FAIL pass pass : 3>&3 (OSH regression)
detailsdetailsdetails
14pass N-I FAIL pass pass pass pass : 3>&3-
detailsdetails
15pass pass pass pass FAIL pass pass 3>&- << EOF (OSH regression: fail to restore fds)
details
16pass pass pass pass FAIL pass pass Open file on descriptor 3 and write to it many times
details
17pass pass pass pass pass pass pass Open file on descriptor 4 and write to it many times
18pass pass pass FAIL FAIL FAIL pass Redirect to empty string
detailsdetailsdetails
19pass pass pass FAIL pass FAIL pass Redirect to file descriptor that's not open
detailsdetails
20pass pass pass pass pass pass pass Open descriptor with exec
21pass pass pass pass pass pass pass Open multiple descriptors with exec
22pass pass pass FAIL FAIL pass pass >| to clobber
detailsdetails
23pass pass pass pass pass pass pass &> redirects stdout and stderr
24pass N-I FAIL FAIL FAIL FAIL FAIL >&word redirects stdout and stderr when word is not a number or -
detailsdetailsdetailsdetailsdetailsdetails
25pass pass pass FAIL pass pass pass 1>&- to close file descriptor
details
26pass N-I FAIL FAIL FAIL FAIL pass 1>&2- to move file descriptor
detailsdetailsdetailsdetailsdetails
27BUG pass pass FAIL FAIL FAIL pass 1>&2- (Bash bug: fail to restore closed fd)
detailsdetailsdetailsdetails
28pass pass pass FAIL FAIL pass pass <> for read/write
detailsdetails
29pass pass pass FAIL FAIL pass pass <> for read/write named pipes
detailsdetails
30pass pass pass FAIL FAIL pass pass &>> appends stdout and stderr
detailsdetails
31pass pass pass pass pass pass pass exec redirect then various builtins
32BUG pass pass FAIL FAIL FAIL ok can't mention big file descriptor
detailsdetailsdetailsdetailsdetails
33pass ok FAIL pass pass pass pass : >/dev/null 2> / (OSH regression: fail to pop fd frame)
detailsdetails
34pass pass pass FAIL pass FAIL pass echo foo >&100 (OSH regression: does not fail with invalid fd 100)
detailsdetails
35pass pass pass FAIL pass TIME pass echo foo >&N where N is first unused fd
detailsdetails
36pass N-I FAIL FAIL FAIL FAIL pass exec {fd}>&- (OSH regression: fails to close fd)
detailsdetailsdetailsdetailsdetails
193 passed, 3 OK, 5 not implemented, 4 BUG, 53 failed, 1 timeouts, 0 cases skipped
1 failed under osh

Details on runs that didn't PASS

toysh1 <&

[toysh stdout] Expected '[foo51]\n', got '[]\n'

stdout:
[]
stderr:
sh: read: No such file or directory
mksh3 2&>1 (is it a redirect or is it like a&>1)

stdout:
status=0
stderr:
ksh3 2&>1 (is it a redirect or is it like a&>1)

[ksh stdout] Expected 'status=127\n', got 'status=0\n'

stdout:
status=0
stderr:
toysh3 2&>1 (is it a redirect or is it like a&>1)

[toysh stdout] Expected 'status=127\n', got 'status=0\n'

stdout:
status=0
stderr:
sush3 2&>1 (is it a redirect or is it like a&>1)

[sush stdout] Expected 'status=127\n', got 'status=0\n'

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

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

[toysh stdout] Expected 'status=1\n', got 'status=0\n'

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

[brush stdout] Expected 'status=1\n', got 'status=0\n'

stdout:
status=0
stderr:
mksh10 Named file descriptor

stdout:
stderr: 
mksh: <stdin>[1]: {myfd}: not found
ksh10 Named file descriptor

[ksh stdout] Expected 'named-fd-contents\n', got ''
[ksh status] Expected 0, got 127

stdout:
stderr: 
E: ksh: <stdin>[1]: {myfd}: inaccessible or not found
sush10 Named file descriptor

[sush stdout] Expected 'named-fd-contents\n', got ''
[sush status] Expected 0, got 127

stdout:
stderr: 
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 1: {myfd}: command not found
brush10 Named file descriptor

[brush stdout] Expected 'named-fd-contents\n', got ''

stdout:
stderr: 
error: invalid redirection
ksh11 Double digit fd (20> file)

[ksh stdout] Expected 'hello20\n', got ''
[ksh status] Expected 0, got 127

stdout:
stderr: 
E: ksh: <stdin>[1]: 20: inaccessible or not found
toysh12 : 9> fdleak (OSH regression)

[toysh stdout] Expected u'', got 'world\n'

stdout:
world
stderr:
mksh13 : 3>&3 (OSH regression)

stdout:
stderr: 
toysh13 : 3>&3 (OSH regression)

[toysh stdout] Expected 'hello\n', got ''
[toysh status] Expected 0, got 2

stdout:
stderr: 
main: line 1: sh: syntax error: (
sush13 : 3>&3 (OSH regression)

[sush stdout] Expected 'hello\n', got ''
[sush status] Expected 0, got 101

stdout:
stderr: 
thread 'main' panicked at src/elements/io.rs:17:27:
cannot close: EBADF
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
mksh14 : 3>&3-

stdout:
stderr: 
mksh: <stdin>[1]: 3>&3- : illegal file descriptor name
ksh14 : 3>&3-

[ksh stdout] Expected 'hello\n', got ''
[ksh status] Expected 0, got 1

stdout:
stderr: 
W: ksh: <stdin>[1]: 3>&3- : illegal file descriptor name
E: ksh: <stdin>[1]: redirection failure
sush15 3>&- << EOF (OSH regression: fail to restore fds)

[sush stdout] Expected 'hello\nworld\n', got ''
[sush status] Expected 0, got 101

stdout:
stderr: 
thread 'main' panicked at src/elements/io.rs:17:27:
cannot close: EBADF
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 4: 1: bad file descriptor

thread 'main' panicked at src/elements/io.rs:17:27:
cannot close: EBADF
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
sush16 Open file on descriptor 3 and write to it many times

[sush stdout] Expected 'hello\nworld\n', got ''
[sush status] Expected 0, got 101

stdout:
stderr: 
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 2: 1: bad file descriptor
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 3: 1: bad file descriptor

thread 'main' panicked at src/elements/io.rs:17:27:
cannot close: EBADF
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
toysh18 Redirect to empty string

[toysh stdout] Expected 'result=1\n', got 'result=1\nDONE\n'
[toysh status] Expected 1, got 0

stdout:
result=1
DONE
stderr:
sh: : No such file or directory
set: bad -o errexit
sh: : No such file or directory
sush18 Redirect to empty string

[sush stdout] Expected 'result=1\n', got 'result=1\nDONE\n'
[sush status] Expected 1, got 0

stdout:
result=1
DONE
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 2: : entity not found
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 4: set: errexit: invalid option name
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 5: : entity not found
brush18 Redirect to empty string

[brush stdout] Expected 'result=1\n', got 'result=1\nDONE\n'
[brush status] Expected 1, got 0

stdout:
result=1
DONE
stderr:
error: failed to redirect to : No such file or directory (os error 2)
error: failed to redirect to : No such file or directory (os error 2)
toysh19 Redirect to file descriptor that's not open

[toysh status] Expected 1, got 2

stdout:
stderr: 
main: line 8: sh: syntax error: 1>&
brush19 Redirect to file descriptor that's not open

[brush stdout] Expected u'', got "7\nFD 7 shouldn't be open\nOPENED:\n0\n1\n10\n11\n12\n13\n14\n16\n2\n3\n4\n5\n6\n7\n8\n9\n"

stdout:
7
FD 7 shouldn't be open
OPENED:
0
1
10
11
12
13
14
16
2
3
4
5
6
7
8
9
stderr:
ERROR 7: Bad file descriptor
toysh22 >| to clobber

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

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

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

stdout:
status=0
YY
YY
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 2: Unexpected token: >|
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 10: Unexpected token: >|
mksh24 >&word redirects stdout and stderr when word is not a number or -

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

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

stdout:
stderr: 
W: ksh: <stdin>[5]: >&ksh-3725867.txt : illegal file descriptor name
grep: ksh-3725867.txt: No such file or directory
grep: ksh-3725867.txt: No such file or directory
toysh24 >&word redirects stdout and stderr when word is not a number or -

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

stdout:
stderr: 
main: line 1: sh: syntax error: (
sush24 >&word redirects stdout and stderr when word is not a number or -

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

stdout:
stderr: 
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 5: sush-3725878.txt: ambiguous redirect
grep: sush-3725878.txt: No such file or directory
grep: sush-3725878.txt: No such file or directory
brush24 >&word redirects stdout and stderr when word is not a number or -

[brush stdout] Expected 'STDOUT\nSTDERR\n', got 'STDOUT\n'

stdout:
STDOUT
stderr:
STDERR
osh24 >&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-3725934.txt'.  Expected D, -, or D- where D is an integer
grep: osh-3725934.txt: No such file or directory
grep: osh-3725934.txt: No such file or directory
toysh25 1>&- to close file descriptor

[toysh stdout] Expected 'hello\n', got ''
[toysh status] Expected 0, got 2

stdout:
stderr: 
main: line 4: sh: syntax error: >&
mksh26 1>&2- to move file descriptor

stdout:
stderr: 
mksh: <stdin>[3]: 6>&5- : illegal file descriptor name
ksh26 1>&2- to move file descriptor

[ksh stdout] Expected 'hello5\nworld6\n', got ''
[ksh status] Expected 0, got 1

stdout:
stderr: 
W: ksh: <stdin>[3]: 6>&5- : illegal file descriptor name
E: ksh: <stdin>[3]: redirection failure
toysh26 1>&2- to move file descriptor

[toysh stdout] Expected 'hello5\nworld6\n', got ''
[toysh status] Expected 0, got 2

stdout:
stderr: 
main: line 4: sh: syntax error: >&
sush26 1>&2- to move file descriptor

[sush stdout] Expected 'hello5\nworld6\n', got ''
[sush status] Expected 0, got 101

stdout:
stderr: 
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 3: 5-: ambiguous redirect
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 5: 1: bad file descriptor

thread 'main' panicked at src/elements/io.rs:17:27:
cannot close: EBADF
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
brush26 1>&2- to move file descriptor

[brush stdout] Expected 'hello5\nworld6\n', got 'hello5\nworld5\n'

stdout:
hello5
world5
stderr:
bash27 1>&2- (Bash bug: fail to restore closed fd)

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

[toysh stdout] Expected u'', got 'hello\nworld\n'
[toysh status] Expected 1, got 0

stdout:
hello
world
stderr:
sush27 1>&2- (Bash bug: fail to restore closed fd)

[sush status] Expected 1, got 101

stdout:
stderr: 
thread 'main' panicked at src/elements/io.rs:17:27:
cannot close: EBADF
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
brush27 1>&2- (Bash bug: fail to restore closed fd)

[brush stdout] Expected u'', got "7\nFD 7 shouldn't be open\nOPENED:\n0\n1\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n2\n20\n21\n22\n23\n24\n28\n3\n4\n5\n6\n7\n8\n9\n6\nFD 6 shouldn't be open\nOPENED:\n0\n1\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n2\n20\n21\n22\n23\n24\n28\n3\n4\n5\n6\n7\n8\n9\nhello\nworld\n"
[brush status] Expected 1, got 0

stdout:
7
FD 7 shouldn't be open
OPENED:
0
1
10
11
12
13
14
15
16
17
18
19
2
20
21
22
23
24
28
3
4
5
6
7
8
9
6
FD 6 shouldn't be open
OPENED:
0
1
10
11
12
13
14
15
16
17
18
19
2
20
21
22
23
24
28
3
4
5
6
7
8
9
hello
world
stderr:
toysh28 <> for read/write

[toysh stdout] Expected 'line=first\nCONTENTS\nfirst\nsecond\n', got 'line=\nCONTENTS\nsecond\n'

stdout:
line=
CONTENTS
second
stderr:
sh: read: No such file or directory
sush28 <> for read/write

[sush stdout] Expected 'line=first\nCONTENTS\nfirst\nsecond\n', got 'line=\nCONTENTS\nfirst\n'

stdout:
line=
CONTENTS
first
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 3: Unexpected token: <>$TMP/rw.txt

/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 3: 0: bad file descriptor
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 5: 1: bad file descriptor
toysh29 <> for read/write named pipes

[toysh stdout] Expected 'line1=first line2=second\n', got 'line1= line2=\n'

stdout:
line1= line2=
stderr:
sh: read: No such file or directory
sh: read: No such file or directory
sush29 <> for read/write named pipes

[sush stdout] Expected 'line1=first line2=second\n', got ''
[sush status] Expected 0, got 101

stdout:
stderr: 
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 4: Unexpected token: <>
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 4: 1: bad file descriptor
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 5: 1: bad file descriptor
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 6: 0: bad file descriptor
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 7: 0: bad file descriptor

thread 'main' panicked at src/elements/io.rs:17:27:
cannot close: EBADF
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
toysh30 &>> appends stdout and stderr

[toysh stdout] Expected 'ok\nok\nok\n', got ''
[toysh status] Expected 0, got -6

stdout:
stderr: 
munmap_chunk(): invalid pointer
sush30 &>> appends stdout and stderr

[sush stdout] Expected 'ok\nok\nok\n', got 'ok\nSTDOUT\n'
[sush status] Expected 0, got 1

stdout:
ok
STDOUT
stderr:
3726864
STDERR
bash32 can't mention big file descriptor

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

[toysh stdout] Expected 'hi\nhi 99\nhi 100\n', got 'hi\nhi\nhi\n'

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

[sush stdout] Expected 'hi\nhi 99\nhi 100\n', got 'hi\nhi\nhi\n'

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

[brush stdout] Expected 'hi\nhi 99\nhi 100\n', got 'hi\nhi\nhi\n'

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

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

stdout:
stderr: 
mksh: <stdin>[1]: can't create /: Is a directory
ksh33 : >/dev/null 2> / (OSH regression: fail to pop fd frame)

[ksh stdout] Expected 'hello\n', got ''
[ksh status] Expected 0, got 1

stdout:
stderr: 
W: ksh: <stdin>[1]: /: create: Is a directory
E: ksh: <stdin>[1]: redirection failure
toysh34 echo foo >&100 (OSH regression: does not fail with invalid fd 100)

[toysh status] Expected 1, got 2

stdout:
stderr: 
main: line 2: sh: syntax error: >&
brush34 echo foo >&100 (OSH regression: does not fail with invalid fd 100)

[brush status] Expected 1, got 0

stdout:
stderr: 
toysh35 echo foo >&N where N is first unused fd

[toysh status] Expected 1, got 2

stdout:
stderr: 
main: line 2: sh: syntax error: (
mksh36 exec {fd}>&- (OSH regression: fails to close fd)

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

[ksh stdout] Expected 'foo55\n', got ''
[ksh status] Expected 0, got 127

stdout:
stderr: 
E: ksh: <stdin>[2]: {fd}: inaccessible or not found
toysh36 exec {fd}>&- (OSH regression: fails to close fd)

[toysh stdout] Expected 'foo55\n', got ''
[toysh status] Expected 0, got 2

stdout:
stderr: 
main: line 1: sh: syntax error: (
sush36 exec {fd}>&- (OSH regression: fails to close fd)

[sush stdout] Expected 'foo55\n', got ''
[sush status] Expected 0, got 127

stdout:
stderr: 
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 2: {fd}: command not found
brush36 exec {fd}>&- (OSH regression: fails to close fd)

[brush stdout] Expected 'foo55\n', got ''

stdout:
stderr: 
error: invalid redirection
error: invalid redirection