Posts Tagged ‘terminal’

Adding an environment variable to Bash PATH in OS X

Saturday, October 4th, 2008

I can never remember how to add environment variables to .bash_profile. This post just reminds me how to do that.

It’s dead simple. Just open up Terminal and enter the following (changing the path ‘/opt/subversion’, naturally):

echo 'export PATH=/opt/subversion:$PATH' >> ~/.bash_profile

If .bash_profile doesn’t exist yet (and it doesn’t by default), it’ll be created. Otherwise, the environment variable will be added to that file.

Credit to Indy Nagpal.