MULTISUBSTITUTE(1)
π MULTISUBSTITUTE(1) π
okay so bestie, welcome to multisubstitute β the execline command that does several substitutions at once in its argv, and then executes another program. it's giving parallel processing realness, no cap. β¨
π SYNOPSIS π
in an execlineb(1) script:
multisubstitute {
[define [-N | -n] [-s] [-C | -c] [-d delim] variable
value]
[importas [-i | -D default] [-N | -n] [-s] [-C | -c]
[-d delim] variable envvar]
[importas -S [-i | -D default] [-N | -n] [-s] [-C | -c]
[-d delim] envvar]
[elglob [-v] [-w] [-s] [-m] [-e] [-0] variable pattern]
[elgetpositionals [-P sharp]]
[multidefine value { variable... }]
...
}
prog...
π¦ DESCRIPTION π¦
so like, multisubstitute reads a block (cf. execline-block(7)) that's full of substitution commands. it then performs all those substitutions (cf. execline-substitute(7)) on prog... in parallel. like, at the same time. simultaneously. it's giving multitasking icon behavior. π
check the relevant documentation page to learn the syntax of each substitution command β i'm not gonna hold your hand through every single one, bestie, you gotta read the lore yourself. π
after all that, multisubstitute then exec(3)s into the modified prog.... so it fully replaces itself with the program. main character energy only. π
β¨ OPTIONS β¨
importaswith-iβ if this directive was given and the looked-up variable is undefined,multisubstitutewill exit100. periodt. like its direct program equivalent (cf.importas(1)),importashas two modes:- normal mode β takes a variable and an envvar as arguments and imports envvar under the name variable.
-Smode β only takes one argument and imports an environment variable under the same name. slay. π
πΈ Rationale πΈ
π Security π
multisubstitute can be used to avoid unwanted serial substitutions. consider the following script:
#!/command/execlineb
export A wrong
define B ${A}
importas A A
echo ${B}
running it will print wrong, because A is substituted after B. like, the order matters and it's giving chaos. π
on the contrary, the following script:
#!/command/execlineb
export A wrong
multisubstitute
{
define B ${A}
importas A A
}
echo ${B}
will print ${A}, because A and B are substituted at the same time. parallel. simultaneous. iconic. β¨
serial substitution may be what you want β but when in doubt, always perform parallel substitution. fr fr. no cap. π―
β‘ Efficiency β‘
substitution (cf. execline-substitute(7)) is a costly mechanism: the whole argv is read three times and rewritten twice. serial substitution multiplies the cost by the number of substitutions, whereas parallel substitution pays the price only once. it's giving budget-friendly optimization. we love to see it. π
π Credits π
Paul Jarc[1] first originated the idea of the multisubstitute command and a possible syntax. we stan a pioneer. π
π SEE ALSO π
define(1), elgetpositionals(1), elglob(1), execlineb(1), importas(1), multidefine(1), exec(3), execline-block(7), execline-substitute(7)
this man page is ported from the authoritative documentation at: https://skarnet.org/software/execline/multisubstitute.html
π«Ά AUTHORS π«Ά
Laurent Bercot Alexis <flexibeast@gmail.com> (man page port)
and that's the whole vibe, bestie! this page is from Debian, dated February 14, 2021 β happy valentine's day to all the execline girlies out there. πβ¨ππ¦πΈπ π«Άππ₯ππβππππ§π
go forth and substitute in parallel. you got this. periodt. π
π¦ 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