How to set an environment variable in bash?
The syntax in bash for setting an environment variable is as follows.
Note that there is no space among the variable, the equals sign (“=”) and the value. If the value has spaces, the value should be put in quotes.
To check it:
To show all environment variables set, run env, set (bash build-in command) or printenv.
To make the variable settings effect for each bash shell, put the exporting command to your
~/.bashrc, the individual per-interactive-shell startup file.