case | dash | bash | mksh | osh | description |
0 | pass | pass | pass | FAIL | Leading redirect |
details | |||||
1 | pass | pass | pass | pass | No command |
2 | pass | pass | pass | FAIL | Redirect in subshell |
details | |||||
3 | ok | pass | ok | FAIL | Redirect in assignment |
details | details | details | |||
4 | pass | pass | pass | FAIL | Redirect in function body. |
details | |||||
5 | pass | pass | pass | pass | Descriptor redirect with spaces |
6 | pass | pass | pass | pass | Filename redirect with spaces |
7 | pass | pass | pass | FAIL | Quoted filename redirect with spaces |
details | |||||
8 | pass | BUG | ok | FAIL | Descriptor redirect with filename |
details | details | details | |||
9 | pass | pass | pass | FAIL | redirect for loop |
details | |||||
10 | pass | pass | ok | FAIL | Prefix redirect for loop -- not allowed |
details | details | ||||
11 | pass | pass | pass | FAIL | Block redirect |
details | |||||
12 | pass | pass | pass | FAIL | Redirect echo to stderr, and then redirect all of stdout somewhere. |
details | |||||
13 | pass | pass | pass | pass | Redirect in the middle of two assignments |
14 | pass | pass | pass | FAIL | Redirect in the middle of a command |
details | |||||
15 | N-I | pass | N-I | FAIL | Named file descriptor |
details | details | details |
45 passed, 4 ok, 2 known unimplemented, 1 known bugs, 12 failed, 0 skipped
osh | 0 Leading redirect [osh stdout] Expected b'hello\n', got b'' stdout: stderr: |
osh | 2 Redirect in subshell [osh stdout] Expected b'\n', got b'foo\n' [osh stderr] Expected b'foo\n', got b'' stdout: foostderr: |
dash | 3 Redirect in assignment stdout: FILE= foo FOO=stderr: |
mksh | 3 Redirect in assignment stdout: FILE= foo FOO=stderr: |
osh | 3 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] )] foostderr: 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 |
osh | 4 Redirect in function body. [osh stderr] Expected b'hi\n', got b'' stdout: histderr: |
osh | 7 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' |
bash | 8 Descriptor redirect with filename stdout: stderr: |
mksh | 8 Descriptor redirect with filename stdout: stderr: /bin/mksh: <stdin>[1]: >&nonexistent-filename__ : illegal file descriptor name |
osh | 8 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 |
osh | 9 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 3stderr: |
mksh | 10 Prefix redirect for loop -- not allowed stdout: stderr: /bin/mksh: <stdin>[1]: for: not found /bin/mksh: <stdin>[2]: syntax error: 'do' unexpected |
osh | 10 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' |
osh | 11 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.txtstderr: |
osh | 12 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.txtstderr: foo |
osh | 14 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 |
dash | 15 Named file descriptor stdout: stderr: /bin/dash: 1: exec: {myfd}: not found |
mksh | 15 Named file descriptor stdout: stderr: /bin/mksh: <stdin>[1]: {myfd}: not found |
osh | 15 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}' |