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 | -x breakcode ] [ -n ] [ -C | -c ] [ -0 | -d delim ] variable ~gen... ; ~loop... ; prog...
or in a execlineb script:
forbacktick [ -p | -x breakcode ] [ -n ] [ -C | -c ] [ -0 | -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 automatically.
- 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
- -p : parallel mode. Do not wait for a loop...
instance to finish before spawning the next one. forbacktick will
still wait for all instances of loop to terminate before
executing prog, though.
- -0 : accept null characters from gen's output,
using them as delimitors. If this option and a -d option are
used simultaneously, the rightmost one wins.
- -x breakcode : If at some point loop...
exits with the breakcode exit code, do not keep looping, but
exec prog immediately. This doesn't apply if the -p option
has been given.
- Other options are used to control
the substitution mechanism for every x. Of course, you can't
split x.
Notes
- Starting with release 1.1.5, forbacktick is marked as obsolescent.
You are advised to use the forbacktickx command
instead.