Results for redirect.test.sh

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
5ok ok ok pass pass Redirect in assignment is invalid
detailsdetailsdetails
6ok ok ok pass pass Redirect in assignment
detailsdetailsdetails
7pass pass pass pass pass Redirect in function body.
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 FAIL FAIL Prefix redirect for loop -- not allowed
detailsdetailsdetails
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 FAIL FAIL Named file descriptor
detailsdetailsdetailsdetails
22pass pass pass pass pass Redirect function stdout
23pass pass pass pass pass Nested function stdout redirect
24ok pass pass pass pass Redirect to empty string
details
25ok pass pass pass pass Redirect to file descriptor that's not open
details
26pass pass pass pass pass Open descriptor with exec
27pass pass pass pass pass Open multiple descriptors with exec
28ok pass pass FAIL FAIL >| to clobber
detailsdetailsdetails
29N-I pass pass FAIL FAIL &> redirects stdout and stderr
detailsdetailsdetails
30N-I pass N-I FAIL FAIL 1>&2- to close file descriptor
detailsdetailsdetailsdetails
31pass pass pass FAIL FAIL <> for read/write
detailsdetails

129 passed, 12 ok, 6 known unimplemented, 1 known bugs, 6 failed, 0 skipped

Details on runs that didn't PASS

dash3 Nonexistent file

stdout:
status=2
stderr:
/bin/dash: 1: cannot open /home/andy/git/oilshell/oil/_tmp/spec-tmp/nonexistent.txt: No such file
dash5 Redirect in assignment is invalid

stdout:
stderr: 
bash5 Redirect in assignment is invalid

stdout:
stderr: 
mksh5 Redirect in assignment is invalid

stdout:
stderr: 
dash6 Redirect in assignment

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

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

stdout:
FILE=
foo
FOO=
stderr:
dash8 Redirect in function body is evaluated multiple times

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

stdout:
stderr: 
/bin/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: 
/bin/mksh: <stdin>[1]: for: not found
/bin/mksh: <stdin>[2]: syntax error: 'do' unexpected
osh16 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
osh_ALT16 Prefix redirect for loop -- not allowed

[osh_ALT 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
dash21 Named file descriptor

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

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

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

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

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

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

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

stdout:
stderr: 
/bin/dash: 1: 9: Bad file descriptor
dash28 >| to clobber

stdout:
status=2
XX
ZZ
stderr:
/bin/dash: 3: cannot create /home/andy/git/oilshell/oil/_tmp/spec-tmp/c.txt: File exists
osh28 >| to clobber

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

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

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

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

stdout:
STDOUT
stderr:
STDERR
osh29 &> redirects stdout and stderr

[osh stdout] Expected u'ok\nok\n', got 'STDOUT\n'
[osh status] Expected 0, got 1

stdout:
STDOUT
stderr:
Started background job with pid 7907
STDERR
osh_ALT29 &> redirects stdout and stderr

[osh_ALT stdout] Expected u'ok\nok\n', got 'STDOUT\n'
[osh_ALT status] Expected 0, got 1

stdout:
STDOUT
stderr:
Started background job with pid 7931
STDERR
dash30 1>&2- to close file descriptor

stdout:
stderr: 
/bin/dash: 2: Syntax error: Bad fd number
mksh30 1>&2- to close file descriptor

stdout:
stderr: 
/bin/mksh: <stdin>[1]: >&2- : illegal file descriptor name
osh30 1>&2- to close file descriptor

[osh status] Expected 0, got 1

stdout:
stderr: 
osh error: Redirect descriptor should look like an integer, got (Str s:2-)
osh_ALT30 1>&2- to close file descriptor

[osh_ALT status] Expected 0, got 1

stdout:
stderr: 
osh error: Redirect descriptor should look like an integer, got (Str s:2-)
osh31 <> for read/write

[osh stdout] Expected u'line=first\nCONTENTS\nfirst\nsecond\n', got ''
[osh status] Expected 0, got 1

stdout:
stderr: 
Traceback (most recent call last):
  File "bin/osh", line 504, in <module>
    main(sys.argv)
  File "bin/osh", line 487, in main
    sys.exit(OilMain(argv))
  File "bin/osh", line 470, in OilMain
    status = OshMain(main_argv, login_shell)
  File "bin/osh", line 409, in OshMain
    status = ex.ExecuteAndRunExitTrap(node)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 1210, in ExecuteAndRunExitTrap
    status = self.Execute(node)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 1192, in Execute
    status = self._Execute(node, fork_external=fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 1145, in _Execute
    status, check_errexit = self._Dispatch(node, fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 882, in _Dispatch
    status = self._ExecuteList(node.children)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 1166, in _ExecuteList
    status = self._Execute(child)  # last status wins
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 1135, in _Execute
    if self.fd_state.Push(redirects, self.waiter):
  File "/home/andy/git/oilshell/oil/bin/../core/process.py", line 207, in Push
    if not self._ApplyRedirect(r, waiter):
  File "/home/andy/git/oilshell/oil/bin/../core/process.py", line 130, in _ApplyRedirect
    raise NotImplementedError(r.op_id)
NotImplementedError: Redir_LessGreat
osh_ALT31 <> for read/write

[osh_ALT stdout] Expected u'line=first\nCONTENTS\nfirst\nsecond\n', got ''
[osh_ALT status] Expected 0, got 1

stdout:
stderr: 
Traceback (most recent call last):
  File "/home/andy/git/oilshell/oil/Python-2.7.13/Lib/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/home/andy/git/oilshell/oil/Python-2.7.13/Lib/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 504, in <module>
    main(sys.argv)
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 487, in main
    sys.exit(OilMain(argv))
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 470, in OilMain
    status = OshMain(main_argv, login_shell)
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 409, in OshMain
    status = ex.ExecuteAndRunExitTrap(node)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 1210, in ExecuteAndRunExitTrap
    status = self.Execute(node)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 1192, in Execute
    status = self._Execute(node, fork_external=fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 1145, in _Execute
    status, check_errexit = self._Dispatch(node, fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 882, in _Dispatch
    status = self._ExecuteList(node.children)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 1166, in _ExecuteList
    status = self._Execute(child)  # last status wins
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 1135, in _Execute
    if self.fd_state.Push(redirects, self.waiter):
  File "/home/andy/git/oilshell/oil/bin/../core/process.py", line 207, in Push
    if not self._ApplyRedirect(r, waiter):
  File "/home/andy/git/oilshell/oil/bin/../core/process.py", line 130, in _ApplyRedirect
    raise NotImplementedError(r.op_id)
NotImplementedError: Redir_LessGreat
FATAL: couldn't import from app bundle '_bin/osh' (1)
Stripping the oil.ovm binary may cause this error.
See https://github.com/oilshell/oil/issues/47