2

Possible Duplicate:
What are PATH and other environment variables, and how can I set or use them?

I'm currently trying out Homebrew and it has told me to list it's folder before the default installation path in the .profile.

After some googling it appears that I have to make this file myself as it is not generated. But I have no idea what a file like this looks like and I struggle finding any examples through the normal channels i.e Google.

Could you guys be of assistance?

2
  • Simply add export PATH=/usr/local/bin:$PATH to your ~/.bash_profile or ~/.profile (if you want it for other shells as well).
    – slhck
    Nov 19, 2012 at 11:15
  • You edit /etc/paths to have "/usr/local/bin" on top to have Homebrew's packages be prioritised.
    – Eivind E B
    Apr 14, 2013 at 12:04

2 Answers 2

0

On OS X there are several locations where you can define $PATH. One is ~/.bash_profile (Terminal.app starts the shell as a login shell on OS X, so it has to be .bash_profile instead of .bashrc). This affects only bash. The other is ~/.MacOSX/environment.plist which can be edited either with the plist editor (if you have XCode installed) or the defaults command. This affects all GUI applications.

However, according to this article environment.plist doesn't work in Mountain Lion anymore and you have to add a line setenv PATH /bin:/usr/bin:... to /etc/launchd.conf instead.

-1

Found this:

export PATH=$PATH:/opt/local/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/local/lib

alias sl='ls'
alias pwd='echo -n `pwd` | pbcopy'

From https://stackoverflow.com/questions/5509587/unix-making-change-to-profile-file

1
  • This doesn't work since Homebrew isn't installed in /opt. Furthermore, only the first line would be necessary. The three others are irrelevant to the question and setting the LD_LIBRARY_PATH is not encouraged. Also, the OP wanted to have Homebrew folders before other PATH directories, not after.
    – slhck
    Nov 19, 2012 at 11:13

Not the answer you're looking for? Browse other questions tagged .