OS X Mavericks bash_profile paths don't work

After editing the login file you need to either run the source command on the login file or create a new terminal session before the updated environment variables will be available.

For Example:

source .bash_profile

I prefer to use this method of adding to the path. That way, if the file is executed multiple times, $PATH doesn't add redundant paths.

##
# DELUXE-HOME-BIN-INSERT
# (do not remove this comment)
##
echo $PATH | grep -q -s "${HOME}/bin"
if [ $? -eq 1 ] ; then
    PATH=$PATH:/bin
    export PATH
fi

I managed to add a path on Mavericks by doing the following:

sudo vi /etc/paths

This opens the file called paths which includes all the local paths etc. In the end of this file I added the path I wanted using the vi editor as shown in the command above. I simply added a line such as /Applications/blabla/my_bin.

It will ask your password and after that it is done. It worked for me, hopefully does the same for you.


Add this to your .zshrc file:

if [ -f ~/.bash_profile ]; then . ~/.bash_profile; fi

This will load up your .bash_profile while zsh is loading since it doesn't load it by default.