How to set the PATH in Terminal?
1. Bash first looks to ".bash_profile" in the home directory for PATH settings.
2. If none, Bash then looks to ".bash_login" for PATH settings.
3. If none, Bash then looks to ".profile".
4. If none, Bash then looks to a system file in "/etc/profile" for default PATH settings.
5. For a new shell after login, Bash looks for a ".bashrc" file.
I cannot find any of the above files (I have Finder set to show hidden files already). Somehow, following some instructions from the internet without really knowing what I was doing over the past week I have set my PATH as follows:
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/ *****/src:/usr/X11/bin
but I cannot find the file that is setting this PATH. I have tried creating a new ".bash_profile" shell file and putting it in various places such as "/bin" and "/usr/bin" but the file is not being read.
* As a temporary workaround I tried using the command "source .bash_profile" upon login to set the PATH using the .bash_profile file that I created, but it does not work.
* I am able to temporarily alter the path using the command "PATH=/usr/local/bin:$PATH" but this only lasts for an active shell; when I close out and reopen a new shell, it reverts to the default.
So my questions are:
Is it correct that there is a "/etc/profile" somewhere that is setting the default PATH? If so where is it? Should I alter it, or create a new ".bash_profile" somewhere to set the PATH? If not, where is my PATH being set? If I should create a new ".bash_profile", what exactly should go in it?
Thanks in advance for any assistance.
iMac, Mac OS X (10.6.4), Terminal 2.1.1