Results for redirect.test.sh

casedashbashmkshoshdescription
0pass pass pass FAIL Leading redirect
details
1pass pass pass pass No command
2pass pass pass FAIL Redirect in subshell
details
3ok pass ok FAIL Redirect in assignment
detailsdetailsdetails
4pass pass pass FAIL Redirect in function body.
details
5pass pass pass pass Descriptor redirect with spaces
6pass pass pass pass Filename redirect with spaces
7pass pass pass pass Quoted filename redirect with spaces
8pass BUG ok FAIL Descriptor redirect with filename
detailsdetailsdetails
9pass pass pass FAIL redirect for loop
details
10pass pass ok FAIL Prefix redirect for loop -- not allowed
detailsdetails
11pass pass pass FAIL Block redirect
details
12pass pass pass FAIL Redirect echo to stderr, and then redirect all of stdout somewhere.
details
13pass pass pass pass Redirect in the middle of two assignments
14pass pass pass FAIL Redirect in the middle of a command
details
15N-I pass N-I FAIL Named file descriptor
detailsdetailsdetails
16pass pass pass pass Redirect function stdout
17pass pass pass pass Nested function stdout redirect

54 passed, 4 ok, 2 known unimplemented, 1 known bugs, 11 failed, 0 skipped

Details on runs that didn't PASS

osh0 Leading redirect

[osh stdout] Expected b'hello\n', got b''

stdout:
stderr: 
osh2 Redirect in subshell

[osh stdout] Expected b'\n', got b'foo\n'
[osh stderr] Expected b'foo\n', got b''

stdout:
foo
stderr:
dash3 Redirect in assignment

stdout:
FILE=
foo
FOO=
stderr:
mksh3 Redirect in assignment

stdout:
FILE=
foo
FOO=
stderr:
osh3 Redirect in assignment

[osh stdout] Expected b'FILE=\nFOO=\n', got b'WARNING: Got redirects in assignment: %s [(Redirect\n op_id: Redir_Great\n arg_word: \n (CompoundWord\n parts: [\n (SimpleVarSub token:(token id:VSub_Name val:"$TMP" span_id:11))\n (LiteralPart token:(token id:Lit_Chars val:/no-command.txt span_id:12))\n ]\n )\n fd: 2\n spids: [10]\n)]\nFILE=\nfoo\nFOO=WARNING: Got redirects in assignment: %s [(Redirect\n op_id: Redir_Great\n arg_word: \n (CompoundWord\n parts: [\n (SimpleVarSub token:(token id:VSub_Name val:"$TMP" span_id:11))\n (LiteralPart token:(token id:Lit_Chars val:/no-command.txt span_id:12))\n ]\n )\n fd: 2\n spids: [10]\n)]\nfoo\n'

stdout:
WARNING: Got redirects in assignment: %s [(Redirect
  op_id: Redir_Great
  arg_word: 
    (CompoundWord
      parts: [
        (SimpleVarSub token:(token id:VSub_Name val:"$TMP" span_id:11))
        (LiteralPart token:(token id:Lit_Chars val:/no-command.txt span_id:12))
      ]
    )
  fd: 2
  spids: [10]
)]
FILE=
foo
FOO=WARNING: Got redirects in assignment: %s [(Redirect
  op_id: Redir_Great
  arg_word: 
    (CompoundWord
      parts: [
        (SimpleVarSub token:(token id:VSub_Name val:"$TMP" span_id:11))
        (LiteralPart token:(token id:Lit_Chars val:/no-command.txt span_id:12))
      ]
    )
  fd: 2
  spids: [10]
)]
foo
stderr:
osh4 Redirect in function body.

[osh stderr] Expected b'hi\n', got b''

stdout:
hi
stderr:
bash8 Descriptor redirect with filename

stdout:
stderr: 
mksh8 Descriptor redirect with filename

stdout:
stderr: 
/bin/mksh: <stdin>[1]: >&/home/andy/git/oil2/_tmp/spec-tmp/nonexistent-filename__ : illegal file descriptor name
osh8 Descriptor redirect with filename

[osh status] Expected 2, got 1

stdout:
stderr: 
Traceback (most recent call last):
  File "bin/osh", line 388, in <module>
    sys.exit(main(sys.argv))
  File "bin/osh", line 378, in main
    return OshMain(main_argv)
  File "bin/osh", line 337, in OshMain
    status = ex.Execute(node)
  File "/home/andy/git/oil2/bin/../core/cmd_exec.py", line 1111, in Execute
    status = self._Execute(node)
  File "/home/andy/git/oil2/bin/../core/cmd_exec.py", line 891, in _Execute
    for r in redirects:
TypeError: 'bool' object is not iterable
osh9 redirect for loop

[osh stdout] Expected b'1\n2\n3\n', got b'1\n2\n3\n1\n2\n3\n'

stdout:
1
2
3
1
2
3
stderr:
mksh10 Prefix redirect for loop -- not allowed

stdout:
stderr: 
/bin/mksh: <stdin>[1]: for: not found
/bin/mksh: <stdin>[2]: syntax error: 'do' unexpected
osh10 Prefix redirect for loop -- not allowed

[osh status] Expected 2, got 127

stdout:
stderr: 
Unexpected error in execvpe('for', ['for', 'i', 'in', '1', '2', '3'], ...): [Errno 2] No such file or directory
osh11 Block redirect

[osh stdout] Expected b'15\n', got b'block-redirect\n15\n'

stdout:
block-redirect
15
stderr:
osh12 Redirect echo to stderr, and then redirect all of stdout somewhere.

[osh stdout] Expected b'10\n', got b'012345789\n10\n'

stdout:
012345789
10
stderr:
foo
osh14 Redirect in the middle of a command

[osh stdout] Expected b'1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 ', got b'-n 4 5 6 \n'

stdout:
-n 4 5 6 
stderr:
dash15 Named file descriptor

stdout:
stderr: 
/bin/dash: 1: exec: {myfd}: not found
mksh15 Named file descriptor

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

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

stdout:
stderr: 
Unexpected error in execvpe('{myfd}', ['{myfd}'], ...): [Errno 2] No such file or directory