execline
Software
skarnet.org

The backtick program

backtick runs a program and stores its output in an environment variable, then executes another program.

Interface

In an execlineb script:

     backtick [ -i | -I | -x | -D default ] [ -N | -n ] [ -E | -e ] variable { prog1... } prog2...

Options

The other options tell backtick what to do if prog1...'s output is not suitable as the contents of an environment variable (i.e. it contains a null character) or if prog1... crashes or exits nonzero:

If the command line can keep running after prog1 crashes or exits nonzero, i.e. if one of the -I, -x -or -D has been given, then backtick also adds the ? variable to the environment. If prog1 exited normally, the variable contains its exit code; otherwise, 256 plus the number of the signal that killed it.