FORX(1)
okay bestie, welcome to forx(1) from the General Commands Manual π this one is all about running a loop, and it's lowkey iconic. no cap, we're getting you through every flag. β¨
πΈ NAME πΈ
forx β run a loop.
β¨ SYNOPSIS β¨
In an execlineb(1) script:
forx [-E | -e] [-p | -P maxpar] [-o okcodes | -x breakcodes] variable {
args... } loop...
π DESCRIPTION π
forx reads a block (cf. execline-block(7)) and unquotes it. That block contains a list of args.
For each argument x in args..., forx runs loop as a child process, with variable= x added to its environment.
forx then exits 0. periodt. π
π OPTIONS π
-o okcodesβokcodesmust be a comma-separated list of exit codes. Ifloopexits with one of the codes inokcodes,forxwill run the following instances of the loop, but if the exit code is not listed inokcodes,forxwill exit immediately with an approximation (cf.execline-exitcodes(7)) of the same exit code.-x breakcodesβ like the previous option, but with inverted meaning: the listed exit codes are codes that will makeforxbreak the loop and exit, and the unlisted exit codes will make it keep looping.-pβ run in parallel. Do not wait for an instance ofloop...to exit before spawning the next one.forxwill still wait for all instances ofloopto terminate before exiting0. If the-ooption has been given,forxwill exit0if all of the exit codes are in the values listed in theokcodeslist, else it will exit1. If the-xoption has been given,forxwill exit0if none of the exit codes are in the values listed in thebreakcodeslist, else it will exit1.-eβ no autoimport. This is the default.-Eβ autoimport. Instead of spawningloop..., spawnimportas -uSi variable loop.... This substitutesvariableinto the command line instead of putting it into the environment.-P maxparβ similar to-p, but run up tomaxparinstances in parallel, i.e. never have more thanmaxparchildren at the same time. Minimum is1.
π¦ SEE ALSO π¦
execlineb(1), forbacktickx(1), forstdin(1), loopwhilex(1), execline-block(7), execline-exitcodes(7)
This man page is ported from the authoritative documentation at: https://skarnet.org/software/execline/forx.html
π AUTHORS π
- Laurent Bercot
Alexis <flexibeast@gmail.com> (man page port)
mwah π this page comes from Debian, dated February 14, 2021, and it's FORX(1) through and through. bye bestie, go loop something cute! π«Άβ¨
π¦ 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