Results for sh-options.test.sh

statusdashbashmkshoshosh_ALT
pass 1731203636
ok 59511
N-I 1811522
BUG 10100
FAIL 00022
total4141414141
casedashbashmkshoshosh_ALTdescription
0pass ok ok pass pass $- with -c
detailsdetails
1N-I ok ok pass pass $- with pipefail
detailsdetailsdetails
2pass pass pass pass pass $- with interactive shell
3pass pass pass pass pass pass short options like sh -e
4pass pass pass pass pass pass long options like sh -o errexit
5N-I pass N-I pass pass pass shopt options like sh -O nullglob
detailsdetails
6BUG pass BUG pass pass can continue after unknown option
detailsdetails
7pass pass pass pass pass set with both options and argv
8pass pass pass pass pass set -o vi/emacs
9N-I pass N-I pass pass vi and emacs are mutually exclusive
detailsdetails
10ok pass pass pass pass nounset
details
11ok pass pass pass pass -u is nounset
details
12pass pass pass pass pass nounset with "$@"
13pass pass pass pass pass set -u -- clears argv
14pass pass pass pass pass set -u -- x y z
15pass pass pass pass pass reset option with long flag
16pass pass pass pass pass reset option with short flag
17ok pass pass pass pass set -eu (flag parsing)
details
18pass pass pass FAIL FAIL -n for no execution (useful with --ast-output)
detailsdetails
19N-I pass pass pass pass pipefail
details
20N-I pass N-I pass pass shopt -p -o prints 'set' options
detailsdetails
21N-I pass N-I pass pass shopt -p prints 'shopt' options
detailsdetails
22N-I pass N-I pass pass shopt with no flags prints options
detailsdetails
23pass pass pass pass pass noclobber off
24ok pass pass FAIL FAIL noclobber on
detailsdetailsdetails
25N-I pass N-I pass pass SHELLOPTS is updated when options are changed
detailsdetails
26N-I pass N-I ok ok SHELLOPTS is readonly
detailsdetailsdetailsdetails
27pass pass pass pass pass set -o lists options
28pass ok ok pass pass set without args lists variables
detailsdetails
29pass pass pass pass pass 'set' and 'eval' round trip
30N-I pass ok N-I N-I set without args and array variables (not in OSH)
detailsdetailsdetailsdetails
31N-I pass N-I N-I N-I set without args and assoc array variables (not in OSH)
detailsdetailsdetailsdetails
32N-I pass N-I pass pass shopt -q
detailsdetails
33N-I ok N-I pass pass shopt -q invalid
detailsdetailsdetails
34N-I N-I N-I pass pass shopt -s strict:all
detailsdetailsdetails
35N-I pass N-I pass pass shopt allows for backward compatibility like bash
detailsdetails
36N-I ok N-I pass pass shopt -p validates option names
detailsdetailsdetails
37N-I ok N-I pass pass shopt -p -o validates option names
detailsdetailsdetails
38ok ok ok pass pass stubbed out bash options
detailsdetailsdetails
39N-I ok N-I pass pass shopt -s nounset doesn't work (may relax this later)
detailsdetailsdetails
40pass ok pass pass pass no-ops not in shopt -p output
details
140 passed, 21 OK, 38 not implemented, 2 BUG, 2 failed, 0 timeouts, 0 cases skipped
2 failed under osh

Details on runs that didn't PASS

bash0 $- with -c

stdout:
huBc
stderr:
mksh0 $- with -c

stdout:
uhc
stderr:
dash1 $- with pipefail

stdout:
stderr: 
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 1: set: Illegal option -o pipefail
bash1 $- with pipefail

stdout:
huBs
stderr:
mksh1 $- with pipefail

stdout:
ush
stderr:
dash5 pass shopt options like sh -O nullglob

stdout:
stderr: 
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 0: Illegal option -O
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 0: Illegal option -O
mksh5 pass shopt options like sh -O nullglob

stdout:
stderr: 
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: /home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: -O: unknown option
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: /home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: -O: unknown option
dash6 can continue after unknown option

stdout:
stderr: 
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 2: set: Illegal option -o STRICT
mksh6 can continue after unknown option

stdout:
stderr: 
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[2]: set: STRICT: bad option
dash9 vi and emacs are mutually exclusive

stdout:
___
___
___
stderr:
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 2: shopt: not found
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 2: shopt: not found
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 2: shopt: not found
mksh9 vi and emacs are mutually exclusive

stdout:
___
___
___
stderr:
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[5]: shopt: not found
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[7]: shopt: not found
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[9]: shopt: not found
dash10 nounset

stdout:
[]
stderr:
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 3: unset: parameter not set
dash11 -u is nounset

stdout:
[]
stderr:
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 3: unset: parameter not set
dash17 set -eu (flag parsing)

stdout:
stderr: 
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 2: unset: parameter not set
osh18 -n for no execution (useful with --ast-output)

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

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

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

stdout:
1
2
3
stderr:
dash19 pipefail

stdout:
0
stderr:
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 3: set: Illegal option -o pipefail
dash20 shopt -p -o prints 'set' options

stdout:
stderr: 
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 1: shopt: not found
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 3: shopt: not found
mksh20 shopt -p -o prints 'set' options

stdout:
stderr: 
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[1]: shopt: not found
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[3]: shopt: not found
dash21 shopt -p prints 'shopt' options

stdout:
stderr: 
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 1: shopt: not found
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 2: shopt: not found
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 3: shopt: not found
mksh21 shopt -p prints 'shopt' options

stdout:
stderr: 
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[1]: shopt: not found
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[2]: shopt: not found
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[3]: shopt: not found
dash22 shopt with no flags prints options

stdout:
0 one.txt
0
stderr:
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 2: shopt: not found
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 6: shopt: not found
mksh22 shopt with no flags prints options

stdout:
0 one.txt
0
stderr:
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[2]: shopt: not found
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[6]: shopt: not found
dash24 noclobber on

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

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

stdout:
0
0
stderr:
osh_ALT24 noclobber on

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

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

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

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

stdout:
status=0
stderr:
mksh26 SHELLOPTS is readonly

stdout:
status=0
stderr:
osh26 SHELLOPTS is readonly

stdout:
stderr: 
  SHELLOPTS=x
  ^~~~~~~~~~
[ stdin ]:1: fatal: Can't assign to readonly value 'SHELLOPTS'
osh_ALT26 SHELLOPTS is readonly

stdout:
stderr: 
  SHELLOPTS=x
  ^~~~~~~~~~
[ stdin ]:1: fatal: Can't assign to readonly value 'SHELLOPTS'
bash28 set without args lists variables

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

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

stdout:
stderr: 
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 1: declare: not found
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 2: Syntax error: "(" unexpected
mksh30 set without args and array variables (not in OSH)

stdout:
__array[0]=1
__array[1]=2
__array[2]='3 4'
stderr:
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[1]: declare: not found
osh30 set without args and array variables (not in OSH)

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

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

stdout:
stderr: 
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 1: typeset: not found
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 2: __assoc[k e y]=v a l: not found
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 3: __assoc[a]=b: not found
mksh31 set without args and assoc array variables (not in OSH)

stdout:
stderr: 
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[1]: typeset: -A: unknown option
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[2]: 'k e y': multi-character character constant
osh31 set without args and assoc array variables (not in OSH)

stdout:
stderr: 
  __assoc[a]=b
  ^~~~~~~~
[ stdin ]:3: fatal: Associative array keys must be strings: $x 'x' "$x" etc.
osh_ALT31 set without args and assoc array variables (not in OSH)

stdout:
stderr: 
  __assoc[a]=b
  ^~~~~~~~
[ stdin ]:3: fatal: Associative array keys must be strings: $x 'x' "$x" etc.
dash32 shopt -q

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

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

stdout:
invalidZZ=127
stderr:
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 1: shopt: not found
bash33 shopt -q invalid

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

stdout:
invalidZZ=127
stderr:
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[1]: shopt: not found
dash34 shopt -s strict:all

stdout:
stderr: 
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 2: Syntax error: Bad function name
bash34 shopt -s strict:all

stdout:
-
-
-
stderr:
/home/andy/git/oilshell/oil/_tmp/spec-bin/bash: line 7: shopt: strict:all: invalid shell option name
/home/andy/git/oilshell/oil/_tmp/spec-bin/bash: line 9: shopt: strict_arith: invalid shell option name
mksh34 shopt -s strict:all

stdout:
-
-
-
stderr:
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[6]: shopt: not found
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[7]: shopt: not found
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[8]: shopt: not found
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[9]: shopt: not found
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[10]: shopt: not found
dash35 shopt allows for backward compatibility like bash

stdout:
status=0
stderr:
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 2: shopt: not found
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 5: shopt: not found
mksh35 shopt allows for backward compatibility like bash

stdout:
status=0
stderr:
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[2]: shopt: not found
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[5]: shopt: not found
dash36 shopt -p validates option names

stdout:
status=127
status=127
stderr:
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 1: shopt: not found
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 3: shopt: not found
bash36 shopt -p validates option names

stdout:
shopt -u nullglob
shopt -u failglob
status=1
nullglob off
failglob off
status=1
stderr:
/home/andy/git/oilshell/oil/_tmp/spec-bin/bash: line 1: shopt: invalid: invalid shell option name
/home/andy/git/oilshell/oil/_tmp/spec-bin/bash: line 3: shopt: invalid: invalid shell option name
mksh36 shopt -p validates option names

stdout:
status=127
status=127
stderr:
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[1]: shopt: not found
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[3]: shopt: not found
dash37 shopt -p -o validates option names

stdout:
status=127
stderr:
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 1: shopt: not found
bash37 shopt -p -o validates option names

stdout:
set +o errexit
set +o nounset
status=1
stderr:
/home/andy/git/oilshell/oil/_tmp/spec-bin/bash: line 1: shopt: invalid: invalid option name
mksh37 shopt -p -o validates option names

stdout:
status=127
stderr:
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[1]: shopt: not found
dash38 stubbed out bash options

stdout:
127
127
127
127
stderr:
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 2: shopt: not found
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 2: shopt: not found
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 2: shopt: not found
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 2: shopt: not found
bash38 stubbed out bash options

stdout:
1
0
0
0
stderr:
/home/andy/git/oilshell/oil/_tmp/spec-bin/bash: line 2: shopt: foo: invalid shell option name
mksh38 stubbed out bash options

stdout:
127
127
127
127
stderr:
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[4]: shopt: not found
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[4]: shopt: not found
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[4]: shopt: not found
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[4]: shopt: not found
dash39 shopt -s nounset doesn't work (may relax this later)

stdout:
N-I
stderr:
bash39 shopt -s nounset doesn't work (may relax this later)

stdout:
status=1
nounset off
stderr:
/home/andy/git/oilshell/oil/_tmp/spec-bin/bash: line 7: shopt: nounset: invalid shell option name
mksh39 shopt -s nounset doesn't work (may relax this later)

stdout:
N-I
stderr:
bash40 no-ops not in shopt -p output

stdout:
shopt -u xpg_echo
--
stderr: