execline
Software
www.skarnet.org
The backtick program
backtick runs a program and uses its output as the argument of
another program.
Interface
backtick [ -i ] [ -n ] [ -s ] [ -C | -c ] [ -d delim ] variable ~prog1... ; prog2...
or in an execlineb script:
backtick [ -i ] [ -n ] [ -s ] [ -C | -c ] [ -d delim ] variable { prog1... } prog2...
- backtick reads prog1... in a
block and unquotes it.
- It runs prog1... as a child process and saves its
output in memory. This output must not contain a null character.
- backtick performs
variable substitution on
prog2..., with variable as key and that output as value.
backtick's options are used to control
the substitution mechanism.
- backtick execs into the modified prog2....
Options
- -i : insist. If prog1 exits non-zero,
backtick exits with the same exit code (or 111 if prog1
crashed for some reason). Without this option, backtick execs into
prog2... no matter what prog1 does, with the null word as
variable's value if prog1 didn't write anything before
dying.
- Other options control
variable substitution.