Chapter 7 of 16 · Deutschnullos.de

The shell

s – speaks Bash, so your scripts just keep running. And Tab knows every command.

s                  interactive
s skript.sh ARG …  run a script
s -c 'befehl'      one command
s -e -x -u -o pipefail   like in bash

Bash scripts run

Almost everything you know from Bash is there: variables, pipes, if/for/while/case, functions, [[ … ]] with patterns and =~, arrays and associative arrays, $(( )), here documents, <(befehl), all ${x…} expansions, set -euo pipefail, select, name references (declare -n), extglob and **/.

The proof of the pudding: Homebrew's brew and git filter-branch run under s with the same output as under bash. Every case is tested against bash 5.

Typing is fun

Startup file: ~/.src. Messages come in German, on one line. The prompt is benutzer@rechner:ordner $ when you're logged in (e.g. over SSH), otherwise just ordner $ – your own prompt via PS1 like in bash.

What's (still) missing

Job control (fg, bg, Ctrl+Z), coproc, read -t, ulimit, times, caller, wait -n. complete is accepted but has no effect – s uses the specs after all.

Where it runs

On NULLos itself! If /bin/s exists, the kernel starts the shell right at boot. Pipes, loops, $( ) and functions work there. exit takes you back to the small kernel shell. On the Mac: all tests green.

For small devices without fork there is a version that starts programs through a single system call.