FORX(1)

πŸ“¦ version 2.9.9.2, in nixpkgs unstable

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 β€” okcodes must be a comma-separated list of exit codes. If loop exits with one of the codes in okcodes, forx will run the following instances of the loop, but if the exit code is not listed in okcodes, forx will 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 make forx break the loop and exit, and the unlisted exit codes will make it keep looping.
  • -p β€” run in parallel. Do not wait for an instance of loop... to exit before spawning the next one. forx will still wait for all instances of loop to terminate before exiting 0. If the -o option has been given, forx will exit 0 if all of the exit codes are in the values listed in the okcodes list, else it will exit 1. If the -x option has been given, forx will exit 0 if none of the exit codes are in the values listed in the breakcodes list, else it will exit 1.
  • -e β€” no autoimport. This is the default.
  • -E β€” autoimport. Instead of spawning loop..., spawn importas -uSi variable loop.... This substitutes variable into the command line instead of putting it into the environment.
  • -P maxpar β€” similar to -p, but run up to maxpar instances in parallel, i.e. never have more than maxpar children at the same time. Minimum is 1.

πŸ¦‹ 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