execline
Software
skarnet.org
The ; program
;/tt> executes a sequence of commands.
Interface
In an execlineb script:
; { prog1... } prog2...
- ; reads prog1 in a
block. It forks and
executes it, then waits for it to complete.
- ; sets the ? environment
variable to the exit code of prog1. If prog1...
was killed by a signal, the ? value is 256 plus the signal
number.
- ; then execs into prog2....
Notes
- ; is the basic sequence operator: it takes two
commands and executes them one by one. execline scripts require it to
wrap external commands that exit instead of natively supporting the
"perform some action, then execute some other program" model.
- ; prog1... "" prog2... is
equivalent to sh -c 'prog1... ; exec prog2...'.
- 256 and above are not valid exit codes for commands, so when the
? environment variable contains 256 or more, it means that the
previous command was killed by a signal. There is no ambiguity here, and
? reports exactly what happened to the previous command;
; does not exit, so there is no need for
exit code approximation.