Setting environment variables for bash

To set environment variables in bash, use the following environment variable setting syntax.

export EnvironmentVariableName=EnvironmentVariableValue

This is a sample to set environment variables.

export LANG=en_us.utf8

What does export mean?

If you use export, the environment variables will be inherited by the program to be executed.

If not used, environment variables are valid only within that shell.

Generally, environment variables are referenced by the program to be executed, so it is common to add export.

Associated Information