{{ define "main" }} {{ $install := "/docs/install/" | relURL }}

POSIX shell · z/OS UNIX System Services

>zash

A small, fast shell in the Almquist tradition, written from scratch in C23. Scripts are plain POSIX sh; the shell stays quick on a machine that bills CPU time and copies an address space on every fork().

Build it Source on GitHub
zos: ~/src/zash — 10 000 command substitutions
time bash -c 'i=0; while [ $i -lt 10000 ]; do x=$(echo hi); i=$((i+1)); done'
real    0m37.12s
user    0m20.32s
sys     0m6.77s

time /bin/sh -c 'i=0; while [ $i -lt 10000 ]; do x=$(echo hi); i=$((i+1)); done'
real    0m12.54s
user    0m3.67s
sys     0m1.22s

time ./zash -c 'i=0; while [ $i -lt 10000 ]; do x=$(echo hi); i=$((i+1)); done'
real    0m0.01s
user    0m0.01s
sys     0m0.01s

Every $( ) starts a process in bash and /bin/sh, and none in zash. One run on z/OS; make bench repeats each case and checks the answers.

C23 Clang & IBM Open XL ASCII or EBCDIC Linux & z/OS
{{ .Content }}
{{ end }}