Reference notes for Inferno's sh(1)
General
See: http://man.postnix.pw/purgatorio/1/sh
Various files in /lib/sh
Source in: /appl/cmd/sh/
Loadable modules at time of writing:
-
argfor commandline argument parsing -
csvfor CSV document parsing -
echowhich seems to just provide echo(1) -
exprfor arithmetic -
file2chanwhich provides a shell interface for file2chan(2) -
mloadwhich allows aliasing of modules loaded to avoid module namespace clashes -
mpexprsame asexprexceptmpexpruses arbitrary-precision integers -
regexfor regular expressions -
sexprsfor S-expressions -
stdfor standard shell functionality (if, for, etc.) -
stringfor string manipulation -
testprovides error reporting for itest(1) testing facilities -
tkas an interface to Tk graphical operations
std
or lets you try several commands in order, stopping when one succeeds:
or {first} {second} ...
You can do a compound if without else:
if{~ some $thing}{
do something
}{~ another $thing}{
do anotherthing
}{
other wise
}