FORBACKTICKX(1)
β¨ FORBACKTICKX(1) β¨
okay so bestie, you're looking at the forbacktickx page from the General Commands Manual and honestly? it's giving "run a program, steal its output, use that as your loop list" and it ATE. let me walk you through it π«Ά
π NAME π
forbacktickx β run a program and use its output as loop elements to run another program. that's it, that's the whole vibe. no cap. π
π¦ SYNOPSIS π¦
in an execlineb(1) script:
forbacktickx [-E | -e] [-p | -P maxpar | -o okcodes | -x breakcodes]
[-N | -n] [-C | -c] [-0 | -d delim] variable { gen... }
loop...
look at all those brackets bestie, it's like a little choose-your-own-adventure π but don't worry, we're gonna go through every single one.
πΈ DESCRIPTION πΈ
so forbacktickx reads a block (cf. execline-block(7)), that's gen..., and it unquotes it. yes. unquotes. iconic behavior.
then it runs gen... as a child process. important note: gen's output must not contain a null character. like, that's a hard no. π«
it reads gen's output as it needs it, splitting it automatically (cf. execline-transform(7)). so you don't gotta do the splitting yourself, she handles it.
for every argument x in that split output, forbacktickx runs loop... as a child process, with variable= x added to its environment. π
and then forbacktickx exits 0. slay.
you can start loop... with importas -u variable variable if you wanna do variable substitution. also, plot twist: forbacktickx is now implemented as a wrapper around the pipeline(1) and forstdin(1) commands, with calls to fdmove(1) to make sure loop... gets called with the proper standard input. iykyk π
β¨ OPTIONS β¨
-pβ Parallel mode, bestie. do not wait for a loop... instance to finish before spawning the next one. she's multitasking. but don't worry,forbacktickxwill still wait for all instances of loop to terminate before exiting, though. so she's not gonna ghost you. π-P maxparβ like-p, but with a maximum of maxpar parallel instances. this is the "please don't completely clog the machine in pathological cases" option and honestly bless whoever added it π-o okcodesβ okcodes must be a comma-separated list of exit codes. here's the tea: if the-pflag hasn't been given and loop exits with one of the codes in okcodes,forbacktickxwill run the following instances of the loop. but if the exit code is not listed in okcodes,forbacktickxwill exit immediately with an approximation (cf.execline-exitcodes(7)) of the same exit code. so like, she matches your energy, but only if you told her to. β¨-x breakcodesβ like the previous option, but with inverted meaning, periodt. the listed exit codes are codes that will makeforbacktickxbreak the loop and exit, and the unlisted exit codes will make it keep looping. it's giving opposite day. π-eβ No autoimport. this is the default. π-Eβ Autoimport. instead of spawning loop..., spawnβimportas -ui variable variable loop...β. this substitutes variable into the command line instead of putting it into the environment. main character move honestly. π
other options are similar (in name and functionality) to the switches passed to control a substitution mechanism[1] (cf. execline-transform(7)), and that's on purpose. however β and this is important bestie β forbacktickx does not call the substitution mechanism and has its own semantics for those options. so don't get it twisted. π
-Nβ store the whole line in variable, including the terminating newline (or other delimiter). keep the whole thing. no trimming. π-nβ chomp a terminating delimiter from the line from stdin before storing it into variable. this is the default. she's a little neater. βοΈ-Cβ Crunch. if there's an empty line (i.e. one that only contains a delimiter), do not call loop. also, watch out: if this option is given, and chomping is active, and the last line of stdin is not terminated by a delimiter, then this last line will not be processed. so like, heads up β οΈ that last line just gets dropped, fr fr.-cβ do not crunch, call loop even if the line is empty. this is the default. she's inclusive, she calls everyone. π«Ά-0β accept null characters on its stdin, using them as delimiters. and if this option and a-doption are used simultaneously, the rightmost one wins. rightmost rights, that's the rule. π-d delimβ use the characters in string delim as delimiters for a line. default isβ\nβ, meaning the input is only split on newlines. standard behavior, no notes. π
π§ SEE ALSO π§
execlineb(1), fdmove(1), forstdin(1), forx(1), loopwhilex(1), pipeline(1), execline-block(7), execline-exitcodes(7), execline-transform(7)
this man page is ported from the authoritative documentation at: https://skarnet.org/software/execline/forbacktickx.html β go check it out if you want the original source of truth, bestie π
π AUTHORS π
- Laurent Bercot
- Alexis <flexibeast@gmail.com> (man page port)
and that's the whole page! π this version came from Debian, dated February 14, 2021 β a Valentine's Day gift to Unix nerds everywhere, and honestly? the most romantic thing a man page could do. mwah π go write some loops, bestie. π¦β¨
π¦ 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