• 3
name Punditsdkoslkdosdkoskdo

On which location $PATH get sets in OS X 10.6 Snow Leopard?

I type echo $PATH on the command line and get


I'm wondering where this is getting set since my .bash_login file is empty.

I'm particularly concerned that, after installing MacPorts, it installed a bunch of junk in /opt. I don't think that directory even exists in a normal Mac OS X install.

When bash starts it reads the following files every time you login. For the purposes of OS X, this means every time you open a new Terminal window.

~/.bash_login   (if .bash_profile does not exist)
~/.profile      (if .bash_login does not exist)

When you start a new shell by typing bash on the command line, it reads .bashrc

OS X also uses ~/.MacOSX/environment.plist to set more environment variables, including paths if necessary.

Finally, /etc/paths and /etc/paths.d are read by the shell too.

/opt/local/bin etc. are added in ~/.tcshrc by MacPorts. Also be sure to look in ~/.cshrc.

  • 0
Reply Report

Related Questions

Trending Tags