Export (Bash)

Uit De Vliegende Brigade
Versie door Jeroen Strompf (overleg | bijdragen) op 7 nov 2022 om 17:34 (→‎Sources)
(wijz) ← Oudere versie | Huidige versie (wijz) | Nieuwere versie → (wijz)
Naar navigatie springen Naar zoeken springen
$ export --help

export: export [-fn] [name[=value] ...] or export -p

Set export attribute for shell variables.

Marks each NAME for automatic export to the environment of subsequently
executed commands.  If VALUE is supplied, assign VALUE before exporting.

Options:
  -f	refer to shell functions
  -n	remove the export property from each NAME
  -p	display a list of all exported variables and functions

An argument of `--' disables further option processing.

Exit Status:
Returns success unless an invalid option is given or NAME is invalid.

Not for associate arrays

You can't export associate arrays. Associate arrays are a weird animal, and this is probably an example of this [1].

Not for regular arrays?

Oh shit: Exporting seems also to be an issue for regular arrays [2].

See also

Sources