execline
Software
www.skarnet.org
The backtick program
backtick runs a program and uses its output as the argument of
another program.
Interface
backtick [ -n ] [ -s [ -c ] [ -d delim ] ] variable ~prog1... ; prog2...
or in an execlineb script:
backtick [ -n ] [ -s [ -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.
- If the -s option is set, that output is
split according to the crunch flag
and the delim value.
- backtick performs
variable substitution on
prog2..., with variable as key and that output as value.
- backtick execs into the modified prog2....
Options
- -s : perform splitting.
- -c : do not crunch
extra delimitors. 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,
backtick will try and read and
split a valid sequence of netstrings,
and die if it fails.
- -n : chomp. If there is an extra delimitor at
the end of prog1...'s output, remove it. This is probably
what you want in most cases; it's the shell ` construction's default
behaviour.