Where to Set Environment Variables in Mac OS X
At the command line, environmental variables are defined for the current shell and become inherited by any running command or process. They can determine anything from the default shell, the PATH, the users home directory, to the terminal emulation type, current working directory, where a history file is located, language and localization settings, and going further to include shell variables, which include everything from customizations to the bash prompt, colorized ls output, and changes to terminal appearance, to aliases, and much more.
Let’s walk through how to list environment and shell variables, and then how to set and add new environment variables at the command line of Mac OS X.
Displaying Current Environment & Shell Variables in Mac OS X
To quickly get a list of environmental variables, you can use the following command:
printenv
If you want to see a complete list of shell variables, the ‘set’ command can be issued as well:
set
The output of these commands can be lengthy so you may wish to pipe the output through the less or more commands.
Lire la suite…


