all posts

Setting Environment Variables on Mac OS X

Published to Blog on 23 Jul 2014

This is the way I do it and I’m storing the info here because I’ve already looked it up on 3 different occasions.

I store them in my bash profile. To edit that file simply use the following in the terminal:

subl ~/.bash_profile

I use Sublime text editor. You can substitute nano or vm or the command for your preferred editor of choice.

You’ll see stuff like: export SOME_ENVIRONMENT_VARIABLE=”foo”, add whatever you need to add.

After you’ve made your changes you’ll probably want those changes to affect the terminal window you are currently working in. To do that type:

source ~/.bash_profile

Done.


Dan Hounshell
Web geek, nerd, amateur maker. Likes: apis, node, motorcycles, sports, chickens, watches, food, Nashville, Savannah, Cincinnati and family.
Dan Hounshell on Twitter