MULTIDEFINE(1)

πŸ“¦ version 2.9.9.2, in nixpkgs unstable

πŸ¦‹ NAME πŸ¦‹ β€” multidefine(1)

okay so bestie, this is a General Commands Manual page for multidefine(1), and its whole main-character job is literally: split a value and defines several variables at once, then execute another program. πŸ’…βœ¨

🌸 SYNOPSIS 🌸

In an execlineb(1) script:

multidefine [-0] [-r] [-C | -c] [-N | -n] [-d delim] value {
            variables... } prog...

πŸ’– DESCRIPTION πŸ’–

multidefine reads a block (cf. execline-block(7)) containing a list of variables. That block must not be empty β€” like, do not come in here with an empty block, it's not the vibe. 😭

multidefine splits (cf. execline-transform(7)) value, and performs other operations depending on the given options.

Then it performs parallel substitution (cf. execline-substitute(7)) on prog..., using all of the variables in the block as keys. The first word in the split value is assigned to the first variable, the second word is assigned to the second variable, and so on. Every variable is substituted with exactly one word. fr fr.

If a variable is the empty word, then the word in the split value corresponding to its position is not substituted. So you can use empty words to pad the list of variables and only perform substitution on the relevant fields. that's the little hack, iykyk πŸŽ€

multidefine then exec(3)s into the modified prog.... periodt. πŸ’€

✨ OPTIONS ✨

  • -0 β€” If there are more variables in the block than there are words in the split value, the excess variables will be replaced with zero word. Without this option, the excess variables are replaced with the empty word. 🫢
  • -r β€” Behave similarly to the β€œread” shell command. If there are more words in the split value than there are variables in the block, the last variable will be replaced with all the remaining words (and will be split). Without this option, the last variable is replaced with a single word, and the excess words are lost. 😭

Other options are used to control (cf. execline-transform(7)) the substitution mechanism. Note that the value is always split. always always. no cap. πŸ”₯

  • -C | -c β€” these are in the synopsis and fall under the β€œother options” note above: they control (cf. execline-transform(7)) the substitution mechanism, and the value is always split. πŸ’–
  • -N | -n β€” same β€œother options” bucket: controls (cf. execline-transform(7)) the substitution mechanism, and the value is always split. 🌸
  • -d delim β€” synopsis option with the argument delim; it's part of the β€œother options” that control (cf. execline-transform(7)) the substitution mechanism, and the value is always split. πŸ¦‹

πŸ”₯ SEE ALSO πŸ”₯

go check out define(1), elgetpositionals(1), elglob(1), execlineb(1), importas(1), multisubstitute(1), exec(3), execline-block(7), execline-substitute(7), execline-transform(7) β€” all the linked lore bestie, read them and slay. πŸ‘‘

This man page is ported from the authoritative documentation at: https://skarnet.org/software/execline/multidefine.html

πŸ‘‘ AUTHORS πŸ‘‘

Laurent Bercot Alexis <flexibeast@gmail.com> (man page port) πŸ’œ


mwah πŸ’‹ this page is the Debian edition, dated February 14, 2021 β€” that's the source/version and date, bestie, and we are so done. MULTIDEFINE(1) out. πŸŽ€βœ¨

πŸ“¦ where this page comes from