Results for redirect.test.sh

statusdashbashmkshoshosh_ALT
pass 2536343333
ok 70200
N-I 60200
BUG 02000
FAIL 00055
total3838383838
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
5pass BUG pass pass pass Redirect in assignment
details
6pass pass pass pass pass Redirect in function body.
7ok pass pass pass pass Bad redirects in function body
details
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 pass pass Prefix redirect for loop -- not allowed
details
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 pass pass &> redirects stdout and stderr
details
30N-I pass N-I FAIL FAIL 1>&2- to close file descriptor
detailsdetailsdetailsdetails
31pass pass pass FAIL FAIL <> for read/write
detailsdetails
32N-I pass pass pass pass &>> appends stdout and stderr
details
33pass pass pass pass pass exec redirect then various builtins
34pass pass pass pass pass >$file touches a file
35N-I pass pass FAIL FAIL $(< $file) yields the contents of the file
detailsdetailsdetails
36pass pass pass pass pass 2>&1 with no command
37ok pass ok pass pass 2&>1 (is it a redirect or is it like a&>1)
detailsdetails
161 passed, 9 OK, 8 not implemented, 2 BUG, 5 failed, 0 timeouts, 0 cases skipped
5 failed under osh

Details on runs that didn't PASS

dash3 Nonexistent file

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

stdout:
FILE=
FOO=
stderr:
foo
dash7 Bad redirects in function body

stdout:
status=2
stderr:
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 2: cannot create : Directory nonexistent
dash8 Redirect in function body is evaluated multiple times

stdout:
stderr: 
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 2: arithmetic expression: expecting primary: "i++"
dash13 Descriptor redirect with filename

stdout:
stderr: 
/home/andy/git/oilshell/oil/_tmp/spec-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: 
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[1]: for: not found
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[2]: syntax error: 'do' unexpected
dash21 Named file descriptor

stdout:
stderr: 
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 1: exec: {myfd}: not found
mksh21 Named file descriptor

stdout:
stderr: 
/home/andy/git/oilshell/oil/_tmp/spec-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: 
  exec {myfd}> $TMP/named-fd.txt
       ^
[ stdin ]:1: exec: '{myfd}' not found
osh_ALT21 Named file descriptor

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

stdout:
stderr: 
  exec {myfd}> $TMP/named-fd.txt
       ^
[ stdin ]:1: exec: '{myfd}' not found
dash24 Redirect to empty string

stdout:
result=2
stderr:
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 2: cannot create : Directory nonexistent
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 5: cannot create : Directory nonexistent
dash25 Redirect to file descriptor that's not open

stdout:
stderr: 
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 1: 9: Bad file descriptor
dash28 >| to clobber

stdout:
status=2
XX
ZZ
stderr:
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 3: cannot create /home/andy/git/oilshell/oil/_tmp/spec-tmp/redirect.test.sh/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
dash30 1>&2- to close file descriptor

stdout:
stderr: 
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 2: Syntax error: Bad fd number
mksh30 1>&2- to close file descriptor

stdout:
stderr: 
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[1]: >&2- : illegal file descriptor name
osh30 1>&2- to close file descriptor

[osh status] Expected 0, got 1

stdout:
stderr: 
  echo hi 1>&2-
             ^~
[ stdin ]:1: Redirect descriptor should look like an integer, got (value.Str s:2-)
osh_ALT30 1>&2- to close file descriptor

[osh_ALT status] Expected 0, got 1

stdout:
stderr: 
  echo hi 1>&2-
             ^~
[ stdin ]:1: Redirect descriptor should look like an integer, got (value.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 "/home/andy/git/oilshell/oil/bin/oil.py", line 912, in <module>
    sys.exit(main(sys.argv))
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 870, in main
    return AppBundleMain(argv)
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 844, in AppBundleMain
    status = ShellMain('osh', argv0, main_argv, login_shell)
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 662, in ShellMain
    status = main_loop.Batch(ex, c_parser, arena, nodes_out=nodes_out)
  File "/home/andy/git/oilshell/oil/core/main_loop.py", line 163, in Batch
    is_return, is_fatal = ex.ExecuteAndCatch(node)
  File "/home/andy/git/oilshell/oil/osh/cmd_exec.py", line 1784, in ExecuteAndCatch
    status = self._Execute(node, fork_external=fork_external)
  File "/home/andy/git/oilshell/oil/osh/cmd_exec.py", line 1719, in _Execute
    if self.fd_state.Push(redirects, self.waiter):
  File "/home/andy/git/oilshell/oil/core/process.py", line 340, in Push
    if not self._ApplyRedirect(r, waiter):
  File "/home/andy/git/oilshell/oil/core/process.py", line 241, in _ApplyRedirect
    raise NotImplementedError(r.op_id)
NotImplementedError: 159
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/bin/oil.py", line 899, in _cpython_main_hook
    sys.exit(main(sys.argv))
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 870, in main
    return AppBundleMain(argv)
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 844, in AppBundleMain
    status = ShellMain('osh', argv0, main_argv, login_shell)
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 662, in ShellMain
    status = main_loop.Batch(ex, c_parser, arena, nodes_out=nodes_out)
  File "/home/andy/git/oilshell/oil/core/main_loop.py", line 169, in Batch
    return status
  File "/home/andy/git/oilshell/oil/osh/cmd_exec.py", line 1784, in ExecuteAndCatch
    status = self._Execute(node, fork_external=fork_external)
  File "/home/andy/git/oilshell/oil/osh/cmd_exec.py", line 1719, in _Execute
    if self.fd_state.Push(redirects, self.waiter):
  File "/home/andy/git/oilshell/oil/core/process.py", line 340, in Push
    if not self._ApplyRedirect(r, waiter):
  File "/home/andy/git/oilshell/oil/core/process.py", line 325, in _ApplyRedirect
    posix.close(write_fd)
NotImplementedError: 159
FATAL: couldn't import from app bundle '/home/andy/git/oilshell/oil/_tmp/oil-tar-test/oil-0.7.0/_bin/osh' (1)
Stripping the oil.ovm binary may cause this error.
See https://github.com/oilshell/oil/issues/47
dash32 &>> appends stdout and stderr

stdout:
stderr: 
dash35 $(< $file) yields the contents of the file

stdout:
stderr: 
osh35 $(< $file) yields the contents of the file

[osh stdout] Expected 'FOO\n', got '\n'

stdout:
stderr: 
osh_ALT35 $(< $file) yields the contents of the file

[osh_ALT stdout] Expected 'FOO\n', got '\n'

stdout:
stderr: 
dash37 2&>1 (is it a redirect or is it like a&>1)

stdout:
status=0
stderr:
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 2: 2: not found
mksh37 2&>1 (is it a redirect or is it like a&>1)

stdout:
status=0
stderr: