1

I need to set the PATH environment variable in OSX in a particular order (i.e. with /usr/local/bin first in line).

The recommended way to set PATH variables seems to be the /etc/paths files and the /etc/paths.d directory which work but automatically rearrange the order of the specified paths.

I could override this in my .profile but I get the suspicion that programs such as Homebrew do not pick up on user defined environment variables

1

Literally just come across this answer on Stackoverflow, it seems that /etc/profile might be the answer? - although this is shell specific ...

1

To make sure programs launched from the GUI see environment variables, you want to set them in ~/.MacOSX/environment.plist, which like all textual OSX plists is an XML file. I personally use this prefpane to manage it.

Note that the plist is only read when the session starts, so you will need to log out and back in or reboot after setting it.

0

Programs run from the terminal will pickup the $PATH variable in .profile.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.