BACKTICK(1)
Okay bestie, youβve opened BACKTICK(1) from the General Commands Manual, and itβs giving βgrab a programβs output, stash it in an environment variable, then run another programβ energy. π
β¨
πΈ NAME πΈ
backtick β runs a program, stores its output in an environment variable, then executes another program π
π SYNOPSIS π
In an execlineb(1) script:
backtick [-i | -I | -x | -D default] [-N | -n] [[-E | -e] variable {
prog1... } prog2...
π¦ DESCRIPTION π¦
backtick reads prog1... in an execline-block(7) and unquotes it. π«Ά
Then it runs prog1... as a child process and saves its output in memory. π§ β¨
π¨ Warning, bestie: this output must not contain a null character. Like, hard no. π«
Then backtick exec(3)s into prog2..., with variable added to the environment with prog1...βs output as a value. Slay. π
π OPTIONS π
-Nβ Storeprog1...βs output as is, including the last newline, if any. No trimming, no games. π-nβ Chomp an ending newline offprog1...βs output. This is the default. βοΈ-eβ No autoimport. This is the default. π-Eβ Autoimport. Beforeexec(3)βing intoprog2..., perform a substitution (cf.execline-substitute(7)) so that β$?β is replaced withprog1...βs exitcode (if applicable, see below), and β${ variable }β is replaced withprog1...βs output, instead of keeping the results in the environment. The variables will not appear in the environment; if they preexisted inbacktickβs environment, they will be removed. π-iβbacktickexits with an approximation (cf.execline-exitcodes(7)) ofprog1βs exit code, or124ifprog1wrote a null character. This is the default. π₯-Iβ The value ofvariableis set to whatever the start ofprog1...βs output is, up to the first null character, or to whateverprog1...wrote before crashing; chomping is applied if required; then execution proceeds. π-xβvariableis removed from the environment, and execution proceeds. π-D defaultβ The value ofvariableis set todefault, and execution proceeds. π«Ά
π SEE ALSO π
background(1)foreground(1)if(1)ifelse(1)ifte(1)ifthenelse(1)pipeline(1)runblock(1)execline-block(7)
This man page is ported from the authoritative documentation at: https://skarnet.org/software/execline/backtick.html πβ¨
π AUTHORS π
- Laurent Bercot
Alexis <flexibeast@gmail.com>(man page port)
xoxo, Debian π April 16, 2024 π BACKTICK(1) π
π¦ where this page comes from
- nixpkgs unstable: execline 2.9.9.2
- nixpkgs unstable: execline-man-pages 2.9.9.1.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms