summaryrefslogtreecommitdiffhomepage
path: root/bench
diff options
context:
space:
mode:
Diffstat (limited to 'bench')
-rw-r--r--bench/README.md34
1 files changed, 31 insertions, 3 deletions
diff --git a/bench/README.md b/bench/README.md
index c984b31..bb290a7 100644
--- a/bench/README.md
+++ b/bench/README.md
@@ -268,6 +268,10 @@ It matters for anything that starts zash often: a script with a `#!`
line, `zash -c`, a spawned subshell. It does not matter for a long
interactive session.
+Measured with 100 starts each: `-c :` is a bare start, `script` is the
+kernel starting the shell on a one-line file, which is what a `#!` line
+does.
+
## The host's sh
`compat.sh` runs every `tests/posix` script under zash and under the
@@ -287,9 +291,33 @@ found` where zash says `not found`), and the rest are behaviour worth
reading one at a time. Linux numbers are lower-information, because
`/bin/sh` there is usually bash while the `.exp` files come from dash.
-Measured with 100 starts each: `-c :` is a bare start, `script` is the
-kernel starting the shell on a one-line file, which is what a `#!` line
-does.
+Every one of the 28 has been read, and none of them is a zash bug: zash
+agrees with dash on all 38 (that is what the suite says), and the
+falling-out is the IBM shell's. The groups:
+
+| Scripts | What IBM sh does | POSIX / other shells |
+| --- | --- | --- |
+| charset, collate.ascii, test-ops | `[ a \< b ]` fails with `FSUM6807 expression syntax error` | required by POSIX since 1992 |
+| functions, func-edge | arithmetic that spans a newline is `FSUM7425 unknown operator` | whitespace, as in every other shell |
+| readcmd | no `fc`, so `$(fc ...)` is `FSUM7351 not found` | `fc` is a POSIX special builtin |
+| invoke | a script read from standard input loses its backquotes | — |
+| builtins, control | `echo -n` prints `-n` as text | `-n` is unspecified but universal |
+| heredoc | an unterminated here-document at end of file is an error | dash ends it silently, bash warns |
+| arith, arith-edge | `9223372036854775807 + 1` is a fatal error | overflow is undefined; zash wraps |
+| edge, expand-edge | quotes inside `${y:-"q r"}` stay literal; unquoted `$@` keeps empty fields | the dash meaning is the usual one |
+| split | a trailing `IFS` delimiter makes an empty last field | both families drop it |
+| cmdsub | `: $(exit 7)` is 7 | `:` succeeds, so 0 |
+| errexit, errexit-edge | `set -e` reaches into `&&` lists and subshells | it does not |
+| traps | a subshell survives `kill -INT $$`; the script runs on with status 0 instead of dying at 130 | zash and dash die, like the shell itself would |
+| misc | `echo ~` with `HOME` unset stays `~` | unspecified; ash prints nothing |
+| misc-builtins | `type nosuch` is status 1 and says `not a shell builtin` | a status over 0; zash says 127, like bash |
+| params, read-edge, redir, redir-edge, vars | every failure is status 1 | the ash family uses 2 for redirection and assignment errors ([Deliberate differences](../DESIGN.md#deliberate-differences-from-other-shells)) |
+| printf-ext | bytes 193-194 where zash prints 65-66 | the IBM sh is EBCDIC on that path |
+
+The `params, read-edge, redir, redir-edge, vars` row is the only one
+where the choice is ours rather than IBM's: zash follows the ash family,
+as `DESIGN.md` says it would, so a script written for ksh on z/OS that
+tests `$?` against 1 will see 2 for a failed redirection.
z/OS, ASCII build, `-m64`, 200 starts: