Adding an environment variable to Bash PATH in OS X

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.

This entry was posted in How-To and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">