Results for sh-options.test.sh

casedashbashmkshoshosh_ALTosh-byterundescription
0pass ok ok pass pass pass $- with -c
detailsdetails
1N-I ok ok pass pass pass $- with pipefail
detailsdetailsdetails
2pass pass pass pass pass FAIL $- with interactive shell
details
3pass pass pass pass pass pass sh -c
4pass pass pass pass pass pass empty -c input
5pass pass pass pass pass pass empty stdin
6pass pass pass pass pass pass args are passed
7pass pass pass pass pass pass args that look like flags are passed after script
8pass pass pass pass pass pass args that look like flags are passed after -c
9pass pass pass pass pass pass pass short options on command line
10pass pass pass pass pass pass pass long options on command line
11BUG pass BUG pass pass pass can continue after unknown option
detailsdetails
12pass pass pass pass pass pass set with both options and argv
13pass pass pass pass pass pass set -o vi/emacs
14ok pass pass pass pass pass nounset
details
15ok pass pass pass pass pass -u is nounset
details
16pass pass pass pass pass pass nounset with "$@"
17pass pass pass pass pass pass set -u -- clears argv
18pass pass pass pass pass pass set -u -- x y z
19pass pass pass pass pass pass reset option with long flag
20pass pass pass pass pass pass reset option with short flag
21ok pass pass pass pass pass set -eu (flag parsing)
details
22pass pass pass FAIL FAIL FAIL -n for no execution (useful with --ast-output)
detailsdetailsdetails
23N-I pass pass pass pass pass pipefail
details
24N-I pass N-I pass pass pass shopt -p -o
detailsdetails
25N-I pass N-I pass pass pass shopt -p
detailsdetails
26pass pass pass pass pass pass noclobber off
27ok pass pass FAIL FAIL FAIL noclobber on
detailsdetailsdetailsdetails
28N-I pass N-I pass pass pass SHELLOPTS is updated when options are changed
detailsdetails
29N-I pass N-I FAIL FAIL FAIL SHELLOPTS is readonly
detailsdetailsdetailsdetailsdetails
30pass pass pass FAIL FAIL FAIL set -o lists options
detailsdetailsdetails
31pass pass pass FAIL FAIL FAIL set without args lists variables
detailsdetailsdetails
32N-I pass N-I pass pass pass shopt -q
detailsdetails
33N-I ok N-I pass pass pass shopt -q invalid
detailsdetailsdetails
34N-I pass N-I pass pass pass sh -i loads rcfile (when combined with -c)
detailsdetails

167 passed, 9 ok, 16 known unimplemented, 2 known bugs, 5 failed, 0 skipped

Details on runs that didn't PASS

bash0 $- with -c

stdout:
huBc
stderr:
mksh0 $- with -c

stdout:
uhc
stderr:
dash1 $- with pipefail

stdout:
stderr: 
_tmp/spec-bin/dash: 1: set: Illegal option -o pipefail
bash1 $- with pipefail

stdout:
huBs
stderr:
mksh1 $- with pipefail

stdout:
ush
stderr:
osh-byterun2 $- with interactive shell

[osh-byterun stdout] Expected 'FALSE\nTRUE\n', got 'FALSE\n'
[osh-byterun status] Expected 0, got 1

stdout:
FALSE
stderr:
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "/home/andy/git/oilshell/oil/opy/byterun/pyobj.py", line 93, in __call__
    self.func_globals, {})
  File "/home/andy/git/oilshell/oil/opy/byterun/pyvm2.py", line 164, in make_frame
    frame = Frame(code, f_globals, f_locals, self.frame)
  File "/home/andy/git/oilshell/oil/opy/byterun/pyobj.py", line 169, in __init__
    self.f_builtins = f_locals['__builtins__']
KeyError: '__builtins__'
Error in sys.exitfunc:
Traceback (most recent call last):
  File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "/home/andy/git/oilshell/oil/opy/byterun/pyobj.py", line 93, in __call__
    self.func_globals, {})
  File "/home/andy/git/oilshell/oil/opy/byterun/pyvm2.py", line 164, in make_frame
    frame = Frame(code, f_globals, f_locals, self.frame)
  File "/home/andy/git/oilshell/oil/opy/byterun/pyobj.py", line 169, in __init__
    self.f_builtins = f_locals['__builtins__']
KeyError: '__builtins__'
osh 'shopt' usage error: Invalid option 'globstar'
FATAL: maximum recursion depth exceeded in __instancecheck__
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "/home/andy/git/oilshell/oil/opy/byterun/pyobj.py", line 93, in __call__
    self.func_globals, {})
  File "/home/andy/git/oilshell/oil/opy/byterun/pyvm2.py", line 164, in make_frame
    frame = Frame(code, f_globals, f_locals, self.frame)
  File "/home/andy/git/oilshell/oil/opy/byterun/pyobj.py", line 169, in __init__
    self.f_builtins = f_locals['__builtins__']
KeyError: '__builtins__'
Error in sys.exitfunc:
Traceback (most recent call last):
  File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "/home/andy/git/oilshell/oil/opy/byterun/pyobj.py", line 93, in __call__
    self.func_globals, {})
  File "/home/andy/git/oilshell/oil/opy/byterun/pyvm2.py", line 164, in make_frame
    frame = Frame(code, f_globals, f_locals, self.frame)
  File "/home/andy/git/oilshell/oil/opy/byterun/pyobj.py", line 169, in __init__
    self.f_builtins = f_locals['__builtins__']
KeyError: '__builtins__'
dash11 can continue after unknown option

stdout:
stderr: 
_tmp/spec-bin/dash: 2: set: Illegal option -o STRICT
mksh11 can continue after unknown option

stdout:
stderr: 
_tmp/spec-bin/mksh: <stdin>[2]: set: STRICT: bad option
dash14 nounset

stdout:
[]
stderr:
_tmp/spec-bin/dash: 3: unset: parameter not set
dash15 -u is nounset

stdout:
[]
stderr:
_tmp/spec-bin/dash: 3: unset: parameter not set
dash21 set -eu (flag parsing)

stdout:
stderr: 
_tmp/spec-bin/dash: 2: unset: parameter not set
osh22 -n for no execution (useful with --ast-output)

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

stdout:
1
2
3
stderr:
osh_ALT22 -n for no execution (useful with --ast-output)

[osh_ALT stdout] Expected u'1\n', got '1\n2\n3\n'

stdout:
1
2
3
stderr:
osh-byterun22 -n for no execution (useful with --ast-output)

[osh-byterun stdout] Expected u'1\n', got '1\n2\n3\n'

stdout:
1
2
3
stderr:
dash23 pipefail

stdout:
0
stderr:
_tmp/spec-bin/dash: 3: set: Illegal option -o pipefail
dash24 shopt -p -o

stdout:
stderr: 
_tmp/spec-bin/dash: 1: shopt: not found
_tmp/spec-bin/dash: 3: shopt: not found
mksh24 shopt -p -o

stdout:
stderr: 
_tmp/spec-bin/mksh: <stdin>[1]: shopt: not found
_tmp/spec-bin/mksh: <stdin>[3]: shopt: not found
dash25 shopt -p

stdout:
stderr: 
_tmp/spec-bin/dash: 1: shopt: not found
_tmp/spec-bin/dash: 2: shopt: not found
_tmp/spec-bin/dash: 3: shopt: not found
mksh25 shopt -p

stdout:
stderr: 
_tmp/spec-bin/mksh: <stdin>[1]: shopt: not found
_tmp/spec-bin/mksh: <stdin>[2]: shopt: not found
_tmp/spec-bin/mksh: <stdin>[3]: shopt: not found
dash27 noclobber on

stdout:
0
2
stderr:
_tmp/spec-bin/dash: 5: cannot create /home/andy/git/oilshell/oil/_tmp/spec-tmp/sh-options.test.sh/no-clobber: File exists
osh27 noclobber on

[osh stdout] Expected u'0\n1\n', got '0\n0\n'

stdout:
0
0
stderr:
osh_ALT27 noclobber on

[osh_ALT stdout] Expected u'0\n1\n', got '0\n0\n'

stdout:
0
0
stderr:
osh-byterun27 noclobber on

[osh-byterun stdout] Expected u'0\n1\n', got '0\n0\n'

stdout:
0
0
stderr:
dash28 SHELLOPTS is updated when options are changed

stdout:
1
1
1
stderr:
+ echo
+ grep -q xtrace
+ echo 1
+ set +x
mksh28 SHELLOPTS is updated when options are changed

stdout:
1
1
1
stderr:
+ echo
+ grep -q xtrace
+ echo 1
+ set +x
dash29 SHELLOPTS is readonly

stdout:
status=0
stderr:
mksh29 SHELLOPTS is readonly

stdout:
status=0
stderr:
osh29 SHELLOPTS is readonly

[osh stdout] Expected 'status=1\n', got ''
[osh status] Expected 0, got 1

stdout:
stderr: 
*** Error has no source location info ***
fatal: Can't assign to readonly value 'SHELLOPTS'
osh_ALT29 SHELLOPTS is readonly

[osh_ALT stdout] Expected 'status=1\n', got ''
[osh_ALT status] Expected 0, got 1

stdout:
stderr: 
*** Error has no source location info ***
fatal: Can't assign to readonly value 'SHELLOPTS'
osh-byterun29 SHELLOPTS is readonly

[osh-byterun stdout] Expected 'status=1\n', got ''
[osh-byterun status] Expected 0, got 1

stdout:
stderr: 
*** Error has no source location info ***
fatal: Can't assign to readonly value 'SHELLOPTS'
osh30 set -o lists options

[osh status] Expected 0, got 1

stdout:
stderr: 
osh 'set' usage error: Expected argument for option
osh_ALT30 set -o lists options

[osh_ALT status] Expected 0, got 1

stdout:
stderr: 
osh 'set' usage error: Expected argument for option
osh-byterun30 set -o lists options

[osh-byterun status] Expected 0, got 1

stdout:
stderr: 
osh 'set' usage error: Expected argument for option
osh31 set without args lists variables

[osh status] Expected 0, got 1

stdout:
stderr: 
osh_ALT31 set without args lists variables

[osh_ALT status] Expected 0, got 1

stdout:
stderr: 
osh-byterun31 set without args lists variables

[osh-byterun status] Expected 0, got 1

stdout:
stderr: 
dash32 shopt -q

stdout:
nullglob=127
nullglob=127
nullglob,failglob=127
nullglob,failglob=127
stderr:
_tmp/spec-bin/dash: 1: shopt: not found
_tmp/spec-bin/dash: 3: shopt: not found
_tmp/spec-bin/dash: 4: shopt: not found
_tmp/spec-bin/dash: 6: shopt: not found
_tmp/spec-bin/dash: 8: shopt: not found
_tmp/spec-bin/dash: 9: shopt: not found
mksh32 shopt -q

stdout:
nullglob=127
nullglob=127
nullglob,failglob=127
nullglob,failglob=127
stderr:
_tmp/spec-bin/mksh: <stdin>[1]: shopt: not found
_tmp/spec-bin/mksh: <stdin>[3]: shopt: not found
_tmp/spec-bin/mksh: <stdin>[4]: shopt: not found
_tmp/spec-bin/mksh: <stdin>[6]: shopt: not found
_tmp/spec-bin/mksh: <stdin>[8]: shopt: not found
_tmp/spec-bin/mksh: <stdin>[9]: shopt: not found
dash33 shopt -q invalid

stdout:
invalidZZ=127
stderr:
_tmp/spec-bin/dash: 1: shopt: not found
bash33 shopt -q invalid

stdout:
invalidZZ=1
stderr:
_tmp/spec-bin/bash: line 1: shopt: invalidZZ: invalid shell option name
mksh33 shopt -q invalid

stdout:
invalidZZ=127
stderr:
_tmp/spec-bin/mksh: <stdin>[1]: shopt: not found
dash34 sh -i loads rcfile (when combined with -c)

stdout:
1
stderr:
_tmp/spec-bin/dash: 0: Illegal option --
mksh34 sh -i loads rcfile (when combined with -c)

stdout:
1
stderr:
_tmp/spec-bin/mksh: _tmp/spec-bin/mksh: --: unknown option