commands

export — mark environment variables

Bash builtin marks variables for inheritance by subsequently executed programs. It does not change the parent of the current shell. Example assumes a fresh shell lab fixture with new output names.

Formal Syntax & Structure

linux syntaxlinux
export NAME[=VALUE]

Parameters & Attributes

NameTypeDescription
NAMEoperandShell variable name to mark for export; exported values are inherited by subsequently executed commands.
VALUEoperandOptional assigned value; quote when needed. Omit =VALUE to export the current value.

Return Value

exit status and output

Bash builtin marks variables for inheritance by subsequently executed programs. It does not change the parent of the current shell.

Working Example

Example Snippetlinux
export BM_MODE=previewbash -c 'printf "%s\n" "$BM_MODE"'
Linux Reference