Results for sh-options.test.sh

statusbashdashmkshosh
pass 40172240
ok 9661
N-I 126202
BUG 0120
FAIL 0007
total50505050
casebashdashmkshoshdescription
0ok pass ok pass $- with -c
detailsdetails
1ok N-I ok pass $- with pipefail
detailsdetailsdetails
2pass N-I pass pass $- and more options
details
3pass pass pass pass $- with interactive shell
4pass pass pass pass pass short options like sh -e
5pass pass pass pass pass long options like sh -o errexit
6pass N-I N-I pass pass shopt options like sh -O nullglob
detailsdetails
7pass BUG BUG pass can continue after unknown option
detailsdetails
8pass pass pass FAIL set with both options and argv
details
9pass pass pass pass set -o vi/emacs
10pass N-I N-I pass vi and emacs are mutually exclusive
detailsdetails
11pass N-I ok pass interactive shell starts with emacs mode on
detailsdetails
12pass ok pass pass nounset
details
13pass ok pass pass -u is nounset
details
14pass pass pass FAIL nounset with "$@"
details
15pass pass pass FAIL set -u -- clears argv
details
16pass pass pass FAIL set -u -- x y z
details
17pass pass pass pass reset option with long flag
18pass pass pass pass reset option with short flag
19pass ok pass pass set -eu (flag parsing)
details
20pass pass pass FAIL -n for no execution (useful with --ast-output)
details
21pass N-I pass pass pipefail
details
22pass N-I N-I pass shopt -p -o prints 'set' options
detailsdetails
23pass N-I N-I pass shopt -o prints 'set' options
detailsdetails
24pass N-I N-I pass shopt -p prints 'shopt' options
detailsdetails
25pass N-I N-I pass shopt with no flags prints options
detailsdetails
26pass pass pass pass noclobber off
27pass ok pass pass noclobber on
details
28pass N-I pass pass noclobber on <>
details
29pass N-I N-I pass SHELLOPTS is updated when options are changed
detailsdetails
30pass N-I N-I ok SHELLOPTS is readonly
detailsdetailsdetails
31pass N-I N-I FAIL SHELLOPTS and BASHOPTS are set
detailsdetailsdetails
32pass pass BUG FAIL set - -
detailsdetails
33pass pass pass pass set -o lists options
34pass ok ok pass set without args lists variables
detailsdetails
35pass pass pass pass 'set' and 'eval' round trip
36pass N-I ok N-I set without args and array variables (not in OSH)
detailsdetailsdetails
37pass N-I N-I N-I set without args and assoc array variables (not in OSH)
detailsdetailsdetails
38pass N-I N-I pass shopt -q
detailsdetails
39ok N-I N-I pass shopt -q invalid
detailsdetailsdetails
40N-I N-I N-I pass shopt -s strict:all
detailsdetailsdetails
41pass N-I N-I pass shopt allows for backward compatibility like bash
detailsdetails
42ok N-I N-I pass shopt -p validates option names
detailsdetailsdetails
43ok N-I N-I pass shopt -p -o validates option names
detailsdetailsdetails
44ok ok ok pass stubbed out bash options
detailsdetailsdetails
45ok N-I N-I pass shopt -s nounset works in YSH, not in bash
detailsdetailsdetails
46ok N-I N-I pass Unimplemented options - print, query, set, unset
detailsdetailsdetails
47pass N-I N-I pass Unimplemented options - OSH shopt -s ignore_shopt_not_impl
detailsdetails
48pass N-I N-I pass shopt -p exit code (regression)
detailsdetails
49ok pass pass pass no-ops not shown by shopt -p
details
119 passed, 22 OK, 49 not implemented, 3 BUG, 7 failed, 0 timeouts, 0 cases skipped
7 failed under osh

Details on runs that didn't PASS

bash0 $- with -c

stdout:
huBc
stderr:
mksh0 $- with -c

stdout:
uhc
stderr:
bash1 $- with pipefail

stdout:
huBs
stderr:
dash1 $- with pipefail

stdout:
stderr: 
dash: 1: set: Illegal option -o pipefail
mksh1 $- with pipefail

stdout:
ush
stderr:
dash2 $- and more options

stdout:
stderr: 
dash: 3: [[: not found
dash6 pass shopt options like sh -O nullglob

stdout:
stderr: 
dash: 0: Illegal option -O
dash: 0: Illegal option -O
mksh6 pass shopt options like sh -O nullglob

stdout:
stderr: 
mksh: mksh: -O: unknown option
mksh: mksh: -O: unknown option
dash7 can continue after unknown option

stdout:
stderr: 
dash: 2: set: Illegal option -o STRICT
mksh7 can continue after unknown option

stdout:
stderr: 
mksh: <stdin>[2]: set: STRICT: bad option
osh8 set with both options and argv

[osh stdout] Expected 'a b c\n', got ''
[osh stderr] Found 'Traceback (most recent'

stdout:
stderr: 
Traceback (most recent call last):
  File "/home/uke/oil/bin/oils_for_unix.py", line 202, in <module>
    sys.exit(main(sys.argv))
  File "/home/uke/oil/bin/oils_for_unix.py", line 171, in main
    return AppBundleMain(argv)
  File "/home/uke/oil/bin/oils_for_unix.py", line 141, in AppBundleMain
    return shell.Main('osh', arg_r, environ, login_shell, loader, readline)
  File "/home/uke/oil/core/shell.py", line 1253, in Main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/uke/oil/core/main_loop.py", line 336, in Batch
    was_parsed, status = Batch2(cmd_ev, c_parser, errfmt, cmd_flags=cmd_flags)
  File "/home/uke/oil/core/main_loop.py", line 401, in Batch2
    is_return, is_fatal = cmd_ev.ExecuteAndCatch(node, cmd_flags)
  File "/home/uke/oil/osh/cmd_eval.py", line 2175, in ExecuteAndCatch
    status = self._Execute(node)
  File "/home/uke/oil/osh/cmd_eval.py", line 1974, in _Execute
    status = self._Dispatch(node, cmd_st)
  File "/home/uke/oil/osh/cmd_eval.py", line 1701, in _Dispatch
    status = self._DoSimple(node, cmd_st)
  File "/home/uke/oil/osh/cmd_eval.py", line 904, in _DoSimple
    allow_assign=True)
  File "/home/uke/oil/osh/word_eval.py", line 2566, in EvalWordSequence2
    self._EvalWordToParts(w, part_vals, EXTGLOB_FILES)
  File "/home/uke/oil/osh/word_eval.py", line 2048, in _EvalWordToParts
    self._EvalWordPart(p, word_part_vals, eval_flags)
  File "/home/uke/oil/osh/word_eval.py", line 1932, in _EvalWordPart
    self._EvalDoubleQuoted(part.parts, part_vals)
  File "/home/uke/oil/osh/word_eval.py", line 1453, in _EvalDoubleQuoted
    self._EvalWordPart(p, part_vals, QUOTED)
  File "/home/uke/oil/osh/word_eval.py", line 1952, in _EvalWordPart
    self._EvalSimpleVarSub(part, part_vals, quoted)
  File "/home/uke/oil/osh/word_eval.py", line 1827, in _EvalSimpleVarSub
    v = _ValueToPartValue(val, quoted, part)
  File "/home/uke/oil/osh/word_eval.py", line 231, in _ValueToPartValue
    bash_impl.InternalStringArray_GetValues(val), quoted)
NameError: global name 'bash_impl' is not defined
dash10 vi and emacs are mutually exclusive

stdout:
___
___
___
stderr:
dash: 2: shopt: not found
dash: 2: shopt: not found
dash: 2: shopt: not found
mksh10 vi and emacs are mutually exclusive

stdout:
___
___
___
stderr:
mksh: <stdin>[5]: shopt: not found
mksh: <stdin>[8]: shopt: not found
mksh: <stdin>[11]: shopt: not found
dash11 interactive shell starts with emacs mode on

stdout:
stderr: 
mksh11 interactive shell starts with emacs mode on

stdout:
non-interactive
0
1
interactive
0
1
stderr:
mksh: can't find tty fd: No such device or address
mksh: warning: won't have full job control
dash12 nounset

stdout:
[]
stderr:
dash: 3: unset: parameter not set
dash13 -u is nounset

stdout:
[]
stderr:
dash: 3: unset: parameter not set
osh14 nounset with "$@"

[osh stdout] Expected 'a b c\n', got ''
[osh status] Expected 0, got 1
[osh stderr] Found 'Traceback (most recent'

stdout:
stderr: 
Traceback (most recent call last):
  File "/home/uke/oil/bin/oils_for_unix.py", line 202, in <module>
    sys.exit(main(sys.argv))
  File "/home/uke/oil/bin/oils_for_unix.py", line 171, in main
    return AppBundleMain(argv)
  File "/home/uke/oil/bin/oils_for_unix.py", line 141, in AppBundleMain
    return shell.Main('osh', arg_r, environ, login_shell, loader, readline)
  File "/home/uke/oil/core/shell.py", line 1253, in Main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/uke/oil/core/main_loop.py", line 336, in Batch
    was_parsed, status = Batch2(cmd_ev, c_parser, errfmt, cmd_flags=cmd_flags)
  File "/home/uke/oil/core/main_loop.py", line 401, in Batch2
    is_return, is_fatal = cmd_ev.ExecuteAndCatch(node, cmd_flags)
  File "/home/uke/oil/osh/cmd_eval.py", line 2175, in ExecuteAndCatch
    status = self._Execute(node)
  File "/home/uke/oil/osh/cmd_eval.py", line 1974, in _Execute
    status = self._Dispatch(node, cmd_st)
  File "/home/uke/oil/osh/cmd_eval.py", line 1701, in _Dispatch
    status = self._DoSimple(node, cmd_st)
  File "/home/uke/oil/osh/cmd_eval.py", line 904, in _DoSimple
    allow_assign=True)
  File "/home/uke/oil/osh/word_eval.py", line 2566, in EvalWordSequence2
    self._EvalWordToParts(w, part_vals, EXTGLOB_FILES)
  File "/home/uke/oil/osh/word_eval.py", line 2048, in _EvalWordToParts
    self._EvalWordPart(p, word_part_vals, eval_flags)
  File "/home/uke/oil/osh/word_eval.py", line 1932, in _EvalWordPart
    self._EvalDoubleQuoted(part.parts, part_vals)
  File "/home/uke/oil/osh/word_eval.py", line 1453, in _EvalDoubleQuoted
    self._EvalWordPart(p, part_vals, QUOTED)
  File "/home/uke/oil/osh/word_eval.py", line 1952, in _EvalWordPart
    self._EvalSimpleVarSub(part, part_vals, quoted)
  File "/home/uke/oil/osh/word_eval.py", line 1827, in _EvalSimpleVarSub
    v = _ValueToPartValue(val, quoted, part)
  File "/home/uke/oil/osh/word_eval.py", line 231, in _ValueToPartValue
    bash_impl.InternalStringArray_GetValues(val), quoted)
NameError: global name 'bash_impl' is not defined
osh15 set -u -- clears argv

[osh stdout] Expected '\n', got ''
[osh status] Expected 0, got 1
[osh stderr] Found 'Traceback (most recent'

stdout:
stderr: 
Traceback (most recent call last):
  File "/home/uke/oil/bin/oils_for_unix.py", line 202, in <module>
    sys.exit(main(sys.argv))
  File "/home/uke/oil/bin/oils_for_unix.py", line 171, in main
    return AppBundleMain(argv)
  File "/home/uke/oil/bin/oils_for_unix.py", line 141, in AppBundleMain
    return shell.Main('osh', arg_r, environ, login_shell, loader, readline)
  File "/home/uke/oil/core/shell.py", line 1253, in Main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/uke/oil/core/main_loop.py", line 336, in Batch
    was_parsed, status = Batch2(cmd_ev, c_parser, errfmt, cmd_flags=cmd_flags)
  File "/home/uke/oil/core/main_loop.py", line 401, in Batch2
    is_return, is_fatal = cmd_ev.ExecuteAndCatch(node, cmd_flags)
  File "/home/uke/oil/osh/cmd_eval.py", line 2175, in ExecuteAndCatch
    status = self._Execute(node)
  File "/home/uke/oil/osh/cmd_eval.py", line 1974, in _Execute
    status = self._Dispatch(node, cmd_st)
  File "/home/uke/oil/osh/cmd_eval.py", line 1701, in _Dispatch
    status = self._DoSimple(node, cmd_st)
  File "/home/uke/oil/osh/cmd_eval.py", line 904, in _DoSimple
    allow_assign=True)
  File "/home/uke/oil/osh/word_eval.py", line 2566, in EvalWordSequence2
    self._EvalWordToParts(w, part_vals, EXTGLOB_FILES)
  File "/home/uke/oil/osh/word_eval.py", line 2048, in _EvalWordToParts
    self._EvalWordPart(p, word_part_vals, eval_flags)
  File "/home/uke/oil/osh/word_eval.py", line 1932, in _EvalWordPart
    self._EvalDoubleQuoted(part.parts, part_vals)
  File "/home/uke/oil/osh/word_eval.py", line 1453, in _EvalDoubleQuoted
    self._EvalWordPart(p, part_vals, QUOTED)
  File "/home/uke/oil/osh/word_eval.py", line 1952, in _EvalWordPart
    self._EvalSimpleVarSub(part, part_vals, quoted)
  File "/home/uke/oil/osh/word_eval.py", line 1827, in _EvalSimpleVarSub
    v = _ValueToPartValue(val, quoted, part)
  File "/home/uke/oil/osh/word_eval.py", line 231, in _ValueToPartValue
    bash_impl.InternalStringArray_GetValues(val), quoted)
NameError: global name 'bash_impl' is not defined
osh16 set -u -- x y z

[osh stdout] Expected 'x y z\n', got ''
[osh status] Expected 0, got 1
[osh stderr] Found 'Traceback (most recent'

stdout:
stderr: 
Traceback (most recent call last):
  File "/home/uke/oil/bin/oils_for_unix.py", line 202, in <module>
    sys.exit(main(sys.argv))
  File "/home/uke/oil/bin/oils_for_unix.py", line 171, in main
    return AppBundleMain(argv)
  File "/home/uke/oil/bin/oils_for_unix.py", line 141, in AppBundleMain
    return shell.Main('osh', arg_r, environ, login_shell, loader, readline)
  File "/home/uke/oil/core/shell.py", line 1253, in Main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/uke/oil/core/main_loop.py", line 336, in Batch
    was_parsed, status = Batch2(cmd_ev, c_parser, errfmt, cmd_flags=cmd_flags)
  File "/home/uke/oil/core/main_loop.py", line 401, in Batch2
    is_return, is_fatal = cmd_ev.ExecuteAndCatch(node, cmd_flags)
  File "/home/uke/oil/osh/cmd_eval.py", line 2175, in ExecuteAndCatch
    status = self._Execute(node)
  File "/home/uke/oil/osh/cmd_eval.py", line 1974, in _Execute
    status = self._Dispatch(node, cmd_st)
  File "/home/uke/oil/osh/cmd_eval.py", line 1701, in _Dispatch
    status = self._DoSimple(node, cmd_st)
  File "/home/uke/oil/osh/cmd_eval.py", line 904, in _DoSimple
    allow_assign=True)
  File "/home/uke/oil/osh/word_eval.py", line 2566, in EvalWordSequence2
    self._EvalWordToParts(w, part_vals, EXTGLOB_FILES)
  File "/home/uke/oil/osh/word_eval.py", line 2048, in _EvalWordToParts
    self._EvalWordPart(p, word_part_vals, eval_flags)
  File "/home/uke/oil/osh/word_eval.py", line 1932, in _EvalWordPart
    self._EvalDoubleQuoted(part.parts, part_vals)
  File "/home/uke/oil/osh/word_eval.py", line 1453, in _EvalDoubleQuoted
    self._EvalWordPart(p, part_vals, QUOTED)
  File "/home/uke/oil/osh/word_eval.py", line 1952, in _EvalWordPart
    self._EvalSimpleVarSub(part, part_vals, quoted)
  File "/home/uke/oil/osh/word_eval.py", line 1827, in _EvalSimpleVarSub
    v = _ValueToPartValue(val, quoted, part)
  File "/home/uke/oil/osh/word_eval.py", line 231, in _ValueToPartValue
    bash_impl.InternalStringArray_GetValues(val), quoted)
NameError: global name 'bash_impl' is not defined
dash19 set -eu (flag parsing)

stdout:
stderr: 
dash: 2: unset: parameter not set
osh20 -n for no execution (useful with --ast-output)

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

stdout:
1
2
3
stderr:
dash21 pipefail

stdout:
0
stderr:
dash: 3: set: Illegal option -o pipefail
dash22 shopt -p -o prints 'set' options

stdout:
stderr: 
mksh22 shopt -p -o prints 'set' options

stdout:
stderr: 
dash23 shopt -o prints 'set' options

stdout:
stderr: 
mksh23 shopt -o prints 'set' options

stdout:
stderr: 
dash24 shopt -p prints 'shopt' options

stdout:
stderr: 
dash: 1: shopt: not found
dash: 2: shopt: not found
dash: 3: shopt: not found
mksh24 shopt -p prints 'shopt' options

stdout:
stderr: 
mksh: <stdin>[1]: shopt: not found
mksh: <stdin>[2]: shopt: not found
mksh: <stdin>[3]: shopt: not found
dash25 shopt with no flags prints options

stdout:
0 one.txt
0
stderr:
dash: 3: shopt: not found
dash: 8: shopt: not found
mksh25 shopt with no flags prints options

stdout:
0 one.txt
0
stderr:
mksh: <stdin>[3]: shopt: not found
mksh: <stdin>[8]: shopt: not found
dash27 noclobber on

stdout:
create=0
overwrite=2
force=0
force
stderr:
dash: 7: cannot create no-clobber: File exists
dash28 noclobber on <>

stdout:
.oo
stderr:
dash: 4: read: Illegal option -n
dash29 SHELLOPTS is updated when options are changed

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

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

stdout:
status=0
stderr:
mksh30 SHELLOPTS is readonly

stdout:
status=0
stderr:
osh30 SHELLOPTS is readonly

stdout:
stderr: 
  SHELLOPTS=x
  ^~~~~~~~~~
[ stdin ]:1: fatal: Can't assign to readonly value 'SHELLOPTS'
dash31 SHELLOPTS and BASHOPTS are set

stdout:
stderr: 
dash: 1: SHELLOPTS: parameter not set or null
mksh31 SHELLOPTS and BASHOPTS are set

stdout:
stderr: 
mksh: <stdin>[1]: SHELLOPTS: parameter null or not set
osh31 SHELLOPTS and BASHOPTS are set

[osh status] Expected 0, got 1

stdout:
stderr: 
  echo shellopts ${SHELLOPTS:?} > /dev/null
                   ^~~~~~~~~
[ stdin ]:1: fatal: Var SHELLOPTS is empty
mksh32 set - -

stdout:
a b
a b
a b
-
+
-
--
stderr:
osh32 set - -

[osh stdout] Expected 'a b\n- a b\na b\n- -\n- +\n+ -\n--\n', got ''
[osh status] Expected 0, got 1
[osh stderr] Found 'Traceback (most recent'

stdout:
stderr: 
Traceback (most recent call last):
  File "/home/uke/oil/bin/oils_for_unix.py", line 202, in <module>
    sys.exit(main(sys.argv))
  File "/home/uke/oil/bin/oils_for_unix.py", line 171, in main
    return AppBundleMain(argv)
  File "/home/uke/oil/bin/oils_for_unix.py", line 141, in AppBundleMain
    return shell.Main('osh', arg_r, environ, login_shell, loader, readline)
  File "/home/uke/oil/core/shell.py", line 1253, in Main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/uke/oil/core/main_loop.py", line 336, in Batch
    was_parsed, status = Batch2(cmd_ev, c_parser, errfmt, cmd_flags=cmd_flags)
  File "/home/uke/oil/core/main_loop.py", line 401, in Batch2
    is_return, is_fatal = cmd_ev.ExecuteAndCatch(node, cmd_flags)
  File "/home/uke/oil/osh/cmd_eval.py", line 2175, in ExecuteAndCatch
    status = self._Execute(node)
  File "/home/uke/oil/osh/cmd_eval.py", line 1974, in _Execute
    status = self._Dispatch(node, cmd_st)
  File "/home/uke/oil/osh/cmd_eval.py", line 1701, in _Dispatch
    status = self._DoSimple(node, cmd_st)
  File "/home/uke/oil/osh/cmd_eval.py", line 904, in _DoSimple
    allow_assign=True)
  File "/home/uke/oil/osh/word_eval.py", line 2566, in EvalWordSequence2
    self._EvalWordToParts(w, part_vals, EXTGLOB_FILES)
  File "/home/uke/oil/osh/word_eval.py", line 2048, in _EvalWordToParts
    self._EvalWordPart(p, word_part_vals, eval_flags)
  File "/home/uke/oil/osh/word_eval.py", line 1932, in _EvalWordPart
    self._EvalDoubleQuoted(part.parts, part_vals)
  File "/home/uke/oil/osh/word_eval.py", line 1453, in _EvalDoubleQuoted
    self._EvalWordPart(p, part_vals, QUOTED)
  File "/home/uke/oil/osh/word_eval.py", line 1952, in _EvalWordPart
    self._EvalSimpleVarSub(part, part_vals, quoted)
  File "/home/uke/oil/osh/word_eval.py", line 1827, in _EvalSimpleVarSub
    v = _ValueToPartValue(val, quoted, part)
  File "/home/uke/oil/osh/word_eval.py", line 231, in _ValueToPartValue
    bash_impl.InternalStringArray_GetValues(val), quoted)
NameError: global name 'bash_impl' is not defined
dash34 set without args lists variables

stdout:
__GLOBAL='mutated'
__OTHERLOCAL='L'
__mylocal='L'
__var_in_parent_scope='D'
stderr:
mksh34 set without args lists variables

stdout:
__GLOBAL=mutated
__var_in_parent_scope=D
__OTHERLOCAL=L
__mylocal=L
stderr:
dash36 set without args and array variables (not in OSH)

stdout:
stderr: 
dash: 1: declare: not found
dash: 2: Syntax error: "(" unexpected
mksh36 set without args and array variables (not in OSH)

stdout:
__array[0]=1
__array[1]=2
__array[2]='3 4'
stderr:
mksh: <stdin>[1]: declare: not found
osh36 set without args and array variables (not in OSH)

stdout:
stderr: 
dash37 set without args and assoc array variables (not in OSH)

stdout:
stderr: 
dash: 1: typeset: not found
dash: 2: __assoc[k e y]=v a l: not found
dash: 3: __assoc[a]=b: not found
mksh37 set without args and assoc array variables (not in OSH)

stdout:
stderr: 
mksh: <stdin>[1]: typeset: -A: unknown option
mksh: <stdin>[2]: 'k e y': multi-character character constant
osh37 set without args and assoc array variables (not in OSH)

stdout:
stderr: 
  __assoc[a]=b
  ^~~~~~~~
[ stdin ]:3: fatal: Assoc array keys must be strings: $x 'x' "$x" etc. (OILS-ERR-101)
dash38 shopt -q

stdout:
nullglob=127
nullglob=127
nullglob,failglob=127
nullglob,failglob=127
stderr:
dash: 1: shopt: not found
dash: 4: shopt: not found
dash: 6: shopt: not found
dash: 9: shopt: not found
dash: 12: shopt: not found
dash: 13: shopt: not found
mksh38 shopt -q

stdout:
nullglob=127
nullglob=127
nullglob,failglob=127
nullglob,failglob=127
stderr:
mksh: <stdin>[1]: shopt: not found
mksh: <stdin>[4]: shopt: not found
mksh: <stdin>[6]: shopt: not found
mksh: <stdin>[9]: shopt: not found
mksh: <stdin>[12]: shopt: not found
mksh: <stdin>[13]: shopt: not found
bash39 shopt -q invalid

stdout:
invalidZZ=1
stderr:
bash: line 1: shopt: invalidZZ: invalid shell option name
dash39 shopt -q invalid

stdout:
invalidZZ=127
stderr:
dash: 1: shopt: not found
mksh39 shopt -q invalid

stdout:
invalidZZ=127
stderr:
mksh: <stdin>[1]: shopt: not found
bash40 shopt -s strict:all

stdout:
-
-
-
stderr:
bash: line 9: shopt: strict:all: invalid shell option name
bash: line 11: shopt: strict_arith: invalid shell option name
dash40 shopt -s strict:all

stdout:
stderr: 
dash: 3: Syntax error: Bad function name
mksh40 shopt -s strict:all

stdout:
-
-
-
stderr:
mksh: <stdin>[8]: shopt: not found
mksh: <stdin>[9]: shopt: not found
mksh: <stdin>[10]: shopt: not found
mksh: <stdin>[11]: shopt: not found
mksh: <stdin>[12]: shopt: not found
dash41 shopt allows for backward compatibility like bash

stdout:
status=0
stderr:
dash: 3: shopt: not found
dash: 8: shopt: not found
mksh41 shopt allows for backward compatibility like bash

stdout:
status=0
stderr:
mksh: <stdin>[3]: shopt: not found
mksh: <stdin>[8]: shopt: not found
bash42 shopt -p validates option names

stdout:
shopt -u nullglob
shopt -u failglob
status=1
nullglob off
failglob off
status=1
stderr:
bash: line 1: shopt: invalid: invalid shell option name
bash: line 3: shopt: invalid: invalid shell option name
dash42 shopt -p validates option names

stdout:
status=127
status=127
stderr:
dash: 1: shopt: not found
dash: 3: shopt: not found
mksh42 shopt -p validates option names

stdout:
status=127
status=127
stderr:
mksh: <stdin>[1]: shopt: not found
mksh: <stdin>[3]: shopt: not found
bash43 shopt -p -o validates option names

stdout:
set +o errexit
set +o nounset
status=1
stderr:
bash: line 1: shopt: invalid: invalid option name
dash43 shopt -p -o validates option names

stdout:
status=127
stderr:
dash: 1: shopt: not found
mksh43 shopt -p -o validates option names

stdout:
status=127
stderr:
mksh: <stdin>[1]: shopt: not found
bash44 stubbed out bash options

stdout:
1
0
0
0
stderr:
bash: line 1: shopt: ignore_shopt_not_impl: invalid shell option name
bash: line 3: shopt: foo: invalid shell option name
dash44 stubbed out bash options

stdout:
127
127
127
127
stderr:
dash: 1: shopt: not found
dash: 3: shopt: not found
dash: 3: shopt: not found
dash: 3: shopt: not found
dash: 3: shopt: not found
mksh44 stubbed out bash options

stdout:
127
127
127
127
stderr:
mksh: <stdin>[1]: shopt: not found
mksh: <stdin>[5]: shopt: not found
mksh: <stdin>[5]: shopt: not found
mksh: <stdin>[5]: shopt: not found
mksh: <stdin>[5]: shopt: not found
bash45 shopt -s nounset works in YSH, not in bash

stdout:
status=1
nounset off
stderr:
bash: line 7: shopt: nounset: invalid shell option name
dash45 shopt -s nounset works in YSH, not in bash

stdout:
N-I
stderr:
mksh45 shopt -s nounset works in YSH, not in bash

stdout:
N-I
stderr:
bash46 Unimplemented options - print, query, set, unset

stdout:
shopt -u xpg_echo
q=1
shopt -s xpg_echo
shopt -u xpg_echo
p=1
noflag=1
set=1
stderr:
dash46 Unimplemented options - print, query, set, unset

stdout:
stderr: 
mksh46 Unimplemented options - print, query, set, unset

stdout:
stderr: 
dash47 Unimplemented options - OSH shopt -s ignore_shopt_not_impl

stdout:
stderr: 
mksh47 Unimplemented options - OSH shopt -s ignore_shopt_not_impl

stdout:
stderr: 
dash48 shopt -p exit code (regression)

stdout:
stderr: 
mksh48 shopt -p exit code (regression)

stdout:
stderr: 
bash49 no-ops not shown by shopt -p

stdout:
shopt -u xpg_echo
--
stderr: