Shell and Environment

export

Marks shell variables for child processes.

export makes a variable part of the environment inherited by commands started from the shell.

Syntax
export NAME=value

Arguments explained

  • NAME is the variable name.
  • value is the string assigned.
  • -p lists exported variables in many shells.

Common examples

Set an environment variable
export EDITOR=vim

Makes EDITOR visible to commands launched from this shell.

Add to PATH temporarily
export PATH="$HOME/bin:$PATH"

Prepends ~/bin for the current shell session.

export Command
FieldDetails
Commandexport
CategoryShell and Environment
Primary useMarks shell variables for child processes.
Syntaxexport NAME=value