execline
Software
www.skarnet.org
The forbacktick program
forbacktick runs a program and uses its output as loop elements to
run another program.
Interface
forbacktick [ -p ] [ -n ] [ -c ] [ -d delim ] variable ~gen... ; ~loop... ; prog...
or in a execlineb script:
forbacktick [ -p ] [ -n ] [ -c ] [ -d delim ] variable { gen... } { loop... } prog...
- forbacktick reads two
blocks,
gen... and loop..., and unquotes them.
- It runs gen... as a child process. gen's
output must not contain a null character.
- It reads gen's output as it needs,
splitting it according to the crunch
flag and the delim string.
- For every argument x in the split output:
- forbacktick performs
variable substitution on
loop..., with variable as key and x
as value.
- It runs loop... as a child process.
- forbacktick then execs into prog....
Options
- -c : do not crunch
extra delimitors in gen...'s output - which means that two
consecutive delimitors will lead to an invocation of
loop with an empty x. Default: crunch.
- -d delim : use the characters of the string
delim as delimitors for the split.
Default: " \n\r\t". If delim is the empty string, gen's
output should be a valid sequence of netstrings.
- -n : chomp. If gen's output does not end with
a valid delimitor, ignore the last chunk of output.
- -p : parallel mode. Do not wait for a loop...
instance to finish before spawning the next one.