添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
0ok pass ok pass pass $- with -c details details 1ok N-I ok pass pass $- with pipefail details details details 2pass N-I pass pass pass $- and more options details 3pass pass pass pass pass $- with interactive shell 4pass pass pass pass pass pass short options like sh -e 5pass pass pass pass pass pass long options like sh -o errexit 6pass N-I N-I pass pass pass shopt options like sh -O nullglob details details 7pass BUG BUG pass pass can continue after unknown option details details 8pass pass pass pass pass set with both options and argv 9pass pass pass pass pass set -o vi/emacs 10pass N-I N-I pass pass vi and emacs are mutually exclusive details details 11pass N-I ok pass pass interactive shell starts with emacs mode on details details 12pass ok pass pass pass nounset details 13pass ok pass pass pass -u is nounset details 14pass pass pass pass pass nounset with "$@" 15pass pass pass pass pass set -u -- clears argv 16pass pass pass pass pass set -u -- x y z 17pass pass pass pass pass reset option with long flag 18pass pass pass pass pass reset option with short flag 19pass ok pass pass pass set -eu (flag parsing) details 20pass pass pass FAIL FAIL -n for no execution (useful with --ast-output) details details 21pass N-I pass pass pass pipefail details 22pass N-I N-I pass pass shopt -p -o prints 'set' options details details 23pass N-I N-I pass pass shopt -p prints 'shopt' options details details 24pass N-I N-I pass pass shopt with no flags prints options details details 25pass pass pass pass pass noclobber off 26pass ok pass FAIL FAIL noclobber on details details details 27pass N-I N-I pass pass SHELLOPTS is updated when options are changed details details 28pass N-I N-I ok ok SHELLOPTS is readonly details details details details 29pass pass BUG ok ok set - - details details details 30pass pass pass pass pass set -o lists options 31pass ok ok pass pass set without args lists variables details details 32pass pass pass pass pass 'set' and 'eval' round trip 33pass N-I ok N-I N-I set without args and array variables (not in OSH) details details details details 34pass N-I N-I N-I N-I set without args and assoc array variables (not in OSH) details details details details 35pass N-I N-I pass pass shopt -q details details 36ok N-I N-I pass pass shopt -q invalid details details details 37N-I N-I N-I pass pass shopt -s strict:all details details details 38pass N-I N-I pass pass shopt allows for backward compatibility like bash details details 39ok N-I N-I pass pass shopt -p validates option names details details details 40ok N-I N-I pass pass shopt -p -o validates option names details details details 41ok ok ok pass pass stubbed out bash options details details details 42ok N-I N-I pass pass shopt -s nounset works in Oil, not in bash details details details 43ok pass pass pass pass no-ops not in shopt -p output details
149 passed, 24 OK, 40 not implemented, 3 BUG, 2 failed, 0 timeouts, 0 cases skipped
2 failed under osh

Details on runs that didn't PASS

bash 0 $- with -c

stdout:
stderr:
     
mksh 0 $- with -c

stdout:
stderr:
     
bash 1 $- with pipefail

stdout:
stderr:
     
dash 1 $- with pipefail

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

stdout:
stderr:
     
dash 2 $- and more options

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

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

stdout:
stderr: 
mksh: mksh: -O: unknown option
mksh: mksh: -O: unknown option
dash 7 can continue after unknown option

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

stdout:
stderr: 
mksh: <stdin>[2]: set: STRICT: bad option
dash 10 vi and emacs are mutually exclusive

stdout:
stderr:
dash: 2: shopt: not found
dash: 2: shopt: not found
dash: 2: shopt: not found
mksh 10 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
dash 11 interactive shell starts with emacs mode on

stdout:
stderr: 

     
mksh 11 interactive shell starts with emacs mode on

stdout:
non-interactive
interactive
stderr:
     
dash 12 nounset

stdout:
stderr:
dash: 3: unset: parameter not set
dash 13 -u is nounset

stdout:
stderr:
dash: 3: unset: parameter not set
dash 19 set -eu (flag parsing)

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

[osh stdout] Expected '1\n', got '1\n2\n3\n'
stdout:
stderr:
     
osh_ALT 20 -n for no execution (useful with --ast-output)

[osh_ALT stdout] Expected '1\n', got '1\n2\n3\n'
stdout:
stderr:
     
dash 21 pipefail

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

stdout:
stderr: 
dash: 1: shopt: not found
dash: 3: shopt: not found
mksh 22 shopt -p -o prints 'set' options

stdout:
stderr: 
mksh: <stdin>[1]: shopt: not found
mksh: <stdin>[3]: shopt: not found
dash 23 shopt -p prints 'shopt' options

stdout:
stderr: 
dash: 1: shopt: not found
dash: 2: shopt: not found
dash: 3: shopt: not found
mksh 23 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
dash 24 shopt with no flags prints options

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

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

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

[osh stdout] Expected u'0\n1\n', got '0\n0\n'
stdout:
stderr:
     
osh_ALT 26 noclobber on

[osh_ALT stdout] Expected u'0\n1\n', got '0\n0\n'
stdout:
stderr:
rm: cannot remove '/home/andy/git/oilshell/oil/_tmp/spec-tmp/sh-options.test.sh/26-osh_ALT/no-clobber': No such file or directory
dash 27 SHELLOPTS is updated when options are changed

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

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

stdout:
status=0
stderr:
     
mksh 28 SHELLOPTS is readonly

stdout:
status=0
stderr:
     
osh 28 SHELLOPTS is readonly

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

stdout:
stderr: 
  SHELLOPTS=x
  ^~~~~~~~~~
[ stdin ]:1: fatal: Can't assign to readonly value 'SHELLOPTS'
mksh 29 set - -

stdout:
stderr:
     
osh 29 set - -

stdout:
- a b stderr:
     
osh_ALT 29 set - -

stdout:
- a b stderr:
     
dash 31 set without args lists variables

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

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

stdout:
stderr: 
dash: 1: declare: not found
dash: 2: Syntax error: "(" unexpected
mksh 33 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
osh 33 set without args and array variables (not in OSH)

stdout:
stderr: 

     
osh_ALT 33 set without args and array variables (not in OSH)

stdout:
stderr: 

     
dash 34 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
mksh 34 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
osh 34 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_ALT 34 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.
dash 35 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
mksh 35 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
bash 36 shopt -q invalid

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

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

stdout:
invalidZZ=127
stderr:
mksh: <stdin>[1]: shopt: not found
bash 37 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
dash 37 shopt -s strict:all

stdout:
stderr: 
dash: 3: Syntax error: Bad function name
mksh 37 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
dash 38 shopt allows for backward compatibility like bash

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

stdout:
status=0
stderr:
mksh: <stdin>[3]: shopt: not found
mksh: <stdin>[8]: shopt: not found
bash 39 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
dash 39 shopt -p validates option names

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

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

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

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

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

stdout:
stderr:
bash: line 2: shopt: foo: invalid shell option name
dash 41 stubbed out bash options

stdout:
stderr:
dash: 2: shopt: not found
dash: 2: shopt: not found
dash: 2: shopt: not found
dash: 2: shopt: not found
mksh 41 stubbed out bash options

stdout:
stderr:
mksh: <stdin>[4]: shopt: not found
mksh: <stdin>[4]: shopt: not found
mksh: <stdin>[4]: shopt: not found
mksh: <stdin>[4]: shopt: not found
bash 42 shopt -s nounset works in Oil, not in bash

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

stdout:
stderr:
     
mksh 42 shopt -s nounset works in Oil, not in bash

stdout:
stderr: