execline
Software
www.skarnet.org
The foreground program
foreground executes a sequence of commands.
Interface
foreground ~prog1... ; prog2...
or in an execlineb script:
foreground { prog1... } prog2...
- foreground reads prog1 in a
block. It forks and
executes it, then waits for it to complete.
- foreground sets the LASTEXITCODE environment
variable to the exit code of prog1. If prog1...
did not exit normally, the LASTEXITCODE value is 111.
- foreground then execs into prog2....
Notes
- foreground is the basic sequence operator: it takes two
commands and executes them one by one. execline scripts require it to
wrap external commands that do not support the "perform some action,
then execute some other program" model.
- foreground ~prog1... ; prog2... is
equivalent to sh -c 'prog1... ; exec prog2...'.