EXPORT-ARRAY(1)
π EXPORT-ARRAY π
okay bestie, so this is export-array from the General Commands Manual section (section 1, iykyk) β and honestly? she's giving "pack up your faves and yeet them into the environment" main character energy. β¨
πΈ NAME πΈ
export-array β encode a set of values into an environment variable, then execute a program π«Ά
π SYNOPSIS π
In an execline script:
export-array [-d delim] var { value1 value2 ... } prog...
π¦ DESCRIPTION π¦
so here's the vibe: export-array reads a block of values β and yes, that block can absolutely be empty, no judgment π
(it's a block, cf. execline-block(7), the dedicated block manpage bestie) β and then it encodes them straight into the var environment variable.
then it execs into prog. like, it becomes prog. iconic behaviour, no notes. periodt. π«
couple of rules though, and they are lowkey non-negotiable:
varmust be given without a dollar! no$, okay? leave the$at home. π«varmust not contain the character=. literally do not. π
and here's the retrieval tea, because obviously you're gonna want these values back:
A list of values encoded via export-array VAR { value1 value2 ... } can be retrieved via importas -Ssd "" VAR. then ${VAR} will be split into as many words as there are values. π
A list encoded via export-array -d delim VAR { value1 value2 ... } can similarly be retrieved via importas -Ssd delim VAR.
β¨ OPTIONS β¨
-ddelimβ encode the list of values using the first character ofdelimas a terminator. β οΈ only use this when you know that character does not appear in any of the values! like, fr fr, check first! by default, no terminator or character is specified, and the values are encoded as netstrings. π§
bestie warning: that -d character is a terminator, so if it shows up inside your values you're gonna have a bad time. the default netstring encoding exists for a reason, mwah π
π SEE ALSO π
importas(1)πexecline-block(7)π
This man page is ported from the authoritative documentation at: https://skarnet.org/software/execline/export-array.html π
π AUTHORS π
- Laurent Bercot
- Lennart Jablonka
<humm@ljabl.com>(man page port) π
and that's the whole page, bestie! π this one came from the Debian packaging, dated March 26, 2025, and it's filed under EXPORT-ARRAY(1). go encode some values, slay, and remember: no $ on the var. π«Άπ
β¨
π¦ 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