execline
Software
www.skarnet.org
The background program
background launches a command in the background, then goes on
with the execution flow.
Interface
background [ -d ] ~prog1... ; prog2...
or in an execlineb script:
background [ -d ] { prog1... } prog2...
- background reads a prog1... command in a
block and unquotes it.
- It spawns a child executing prog1....
- It sets the LASTPID environment
variable to the pid of the prog1... process.
- It then execs into prog2....
Options
- -d : doublefork. If the -d option is set,
prog1... will run as a grandchild of background. You
can use this option together with
pgrphack on
prog1... to completely separate it from the main execution
flow.
Notes
- background ~prog1... ; prog2... is
equivalent to sh -c 'prog1... & ; exec prog2...'.