Results for sh-options.test.sh

casedashbashmkshoshdescription
0pass ok ok pass $- with -c
detailsdetails
1N-I ok ok pass $- with pipefail
detailsdetailsdetails
2pass pass pass pass sh -c
3pass pass pass pass empty -c input
4pass pass pass pass empty stdin
5pass pass pass pass args are passed
6pass pass pass pass args that look like flags are passed after script
7pass pass pass pass args that look like flags are passed after -c
8pass pass pass pass pass short options on command line
9pass pass pass pass pass long options on command line
10BUG pass BUG pass can continue after unknown option
detailsdetails
11pass pass pass pass set with both options and argv
12ok pass pass pass nounset
details
13ok pass pass pass -u is nounset
details
14pass pass pass pass nounset with "$@"
15pass pass pass pass set -u -- clears argv
16pass pass pass pass set -u -- x y z
17pass pass pass pass reset option with long flag
18pass pass pass pass reset option with short flag
19ok pass pass pass set -eu (flag parsing)
details
20pass pass pass FAIL -n for no execution (useful with --ast-output)
details
21pass pass pass FAIL xtrace
details
22pass pass pass pass errexit aborts early
23pass pass pass FAIL errexit for nonexistent command
details
24pass pass pass pass errexit aborts early on pipeline
25pass pass pass pass errexit with { }
26pass pass pass pass errexit with if and { }
27pass pass pass pass errexit with ||
28pass pass pass pass errexit with &&
29pass pass pass pass errexit with !
30pass pass pass pass errexit with while/until
31N-I pass pass pass errexit with (( ))
details
32pass pass pass pass errexit with subshell
33pass BUG pass pass errexit with command sub
details
34BUG BUG BUG pass errexit with local
detailsdetailsdetails
35ok ok ok pass setting errexit while it's being ignored
detailsdetailsdetails
36pass pass pass pass setting errexit in a subshell works but doesn't affect parent shell
37ok ok ok pass setting errexit while it's being ignored in a subshell
detailsdetailsdetails
38pass pass pass pass errexit double quard
39N-I pass pass pass pipefail
details

135 passed, 13 ok, 3 known unimplemented, 6 known bugs, 3 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: 
/bin/dash: 1: set: Illegal option -o pipefail
bash1 $- with pipefail

stdout:
huB
stderr:
mksh1 $- with pipefail

stdout:
ush
stderr:
dash10 can continue after unknown option

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

stdout:
stderr: 
/bin/mksh: <stdin>[2]: set: STRICT: bad option
dash12 nounset

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

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

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

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

stdout:
1
2
3
stderr:
osh21 xtrace

[osh stderr] Expected '+ echo 2\n', got "+ ['echo', '2']\n"

stdout:
1
2
stderr:
+ ['echo', '2']
osh23 errexit for nonexistent command

[osh status] Expected 127, got 1

stdout:
stderr: 
Unexpected error in execvpe('nonexistent__ZZ', ['nonexistent__ZZ'], ...): [Errno 2] No such file or directory
Line 0 of '<unknown>'
  <no position info for token>
osh failed: 'SimpleCommand' command exited with status 127
dash31 errexit with (( ))

stdout:
stderr: 
/bin/dash: 3: i++: not found
bash33 errexit with command sub

stdout:
one
two
stderr:
dash34 errexit with local

stdout:
good
bad
stderr:
bash34 errexit with local

stdout:
good
bad
stderr:
mksh34 errexit with local

stdout:
good
bad
stderr:
dash35 setting errexit while it's being ignored

stdout:
1
2
3
4
5
6
stderr:
bash35 setting errexit while it's being ignored

stdout:
1
2
3
4
5
6
stderr:
mksh35 setting errexit while it's being ignored

stdout:
1
2
3
4
5
6
stderr:
dash37 setting errexit while it's being ignored in a subshell

stdout:
1
2
3
4
5
6
stderr:
bash37 setting errexit while it's being ignored in a subshell

stdout:
1
2
3
4
5
6
stderr:
mksh37 setting errexit while it's being ignored in a subshell

stdout:
1
2
3
4
5
6
stderr:
dash39 pipefail

stdout:
0
stderr:
/bin/dash: 3: set: Illegal option -o pipefail