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 FAIL Quoted filename redirect with spaces
details
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

45 passed, 4 ok, 2 known unimplemented, 1 known bugs, 12 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: [(LiteralPart token:(token id:Lit_Chars val:_tmp/no-command.txt span_id:11))]\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: [(LiteralPart token:(token id:Lit_Chars val:_tmp/no-command.txt span_id:11))]\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: [(LiteralPart token:(token id:Lit_Chars val:_tmp/no-command.txt span_id:11))]
    )
  fd: 2
  spids: [10]
)]
FILE=
foo
FOO=WARNING: Got redirects in assignment: %s [(Redirect
  op_id: Redir_Great
  arg_word: 
    (CompoundWord
      parts: [(LiteralPart token:(token id:Lit_Chars val:_tmp/no-command.txt span_id:11))]
    )
  fd: 2
  spids: [10]
)]
foo
stderr:
FOO=WARNING: Got redirects in assignment: %s [(Redirect
  op_id: Redir_Great
  arg_word: 
    (CompoundWord
      parts: [(LiteralPart token:(token id:Lit_Chars val:_tmp: No such file or directory
osh4 Redirect in function body.

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

stdout:
hi
stderr:
osh7 Quoted filename redirect with spaces

[osh stdout] Expected b'two 1\n', got b''

stdout:
stderr: 
Traceback (most recent call last):
  File "bin/osh", line 378, in <module>
    sys.exit(main(sys.argv))
  File "bin/osh", line 368, in main
    return OshMain(main_argv)
  File "bin/osh", line 327, in OshMain
    status, cflow = ex.Execute(node)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 758, in Execute
    status, cflow = self.Execute(child)  # last status wins
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 659, in Execute
    argv = self.ev.EvalWords(node.words)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 791, in EvalWords
    ok, val = self.EvalCompoundWord(w, ifs=ifs, do_glob=do_glob)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 580, in EvalCompoundWord
    ok, val = self.EvalWordPart(p, quoted=False)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 685, in EvalWordPart
    val = self.token.val
AttributeError: 'NormalEvaluator' object has no attribute 'token'
bash8 Descriptor redirect with filename

stdout:
stderr: 
mksh8 Descriptor redirect with filename

stdout:
stderr: 
/bin/mksh: <stdin>[1]: >&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 378, in <module>
    sys.exit(main(sys.argv))
  File "bin/osh", line 368, in main
    return OshMain(main_argv)
  File "bin/osh", line 327, in OshMain
    status, cflow = ex.Execute(node)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 686, 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: b'/home/andy/bin/for'
osh11 Block redirect

[osh stdout] Expected b'15 _tmp/br.txt\n', got b'block-redirect\n15 _tmp/br.txt\n'

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

[osh stdout] Expected b'10 _tmp/block-stdout.txt\n', got b'012345789\n10 _tmp/block-stdout.txt\n'

stdout:
012345789
10 _tmp/block-stdout.txt
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''

stdout:
stderr: 
Traceback (most recent call last):
  File "bin/osh", line 378, in <module>
    sys.exit(main(sys.argv))
  File "bin/osh", line 368, in main
    return OshMain(main_argv)
  File "bin/osh", line 327, in OshMain
    status, cflow = ex.Execute(node)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 758, in Execute
    status, cflow = self.Execute(child)  # last status wins
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 697, in Execute
    self.fd_state.RestoreAll()
  File "/home/andy/git/oil/bin/../core/process.py", line 73, in RestoreAll
    os.close(fd)
OSError: [Errno 9] Bad file descriptor
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: b'/home/andy/bin/{myfd}'