bash/terminal: how to save PATH variable

I've followed the instructions here and elsewhere:
http://www.linuxheadquarters.com/howto/basic/path.shtml

I've set the PATH variable in ~/.profile and in .bashrc, but everytime I close terminal and re-open it, the changes don't take effect. What else would I need to do?

Macbook Pro, late 2008, Mac OS X (10.5.5)

Posted on May 11, 2009 6:04 PM

Reply
12 replies

May 11, 2009 7:21 PM in response to DanInNY

How did you create these files? They need to be linefeed terminated files

file .bashrc
.bashrc: ASCII English text
file .profile
.profile: ASCII English text

It should NOT say CRLF nor CR line termintors.

What shell are you using?

echo $SHELL

Is there a .bash_profile? There is a specific order to when and where shell initialization files are read.

If bash, see

man bash

As a diagnostic, you might insert some echo statements into the various shell initialization files

echo "Starting: .profile"
echo "Starting: .bashrc"
etc...

May 12, 2009 12:57 AM in response to DanInNY

Personally, I don't have a .profile, what I have is .bash_profile, which I created as Plain Text using TextEdit, and added the stuff I wanted. Here's the sum total of that file:

PATH=$PATH:"/Developer/Tools/"
export PATH
PAGER="less -ERmX~"
export PAGER
alias locoup='sudo /usr/libexec/locate.updatedb'
alias octop='stat -f%#Op'
PS1='NoobiX:\w \u\$ ' ;

I must admit I no longer remember WHY some of those items are there. Anyway, when I check my PATH in bash, I get this:

NoobiX:~ francine$ echo $PATH
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Developer/Tools/

So Developer Tools is indeed in my PATH, and I can use the items I've got there easily.
Francine

User uploaded file
Francine
Schwieder

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

bash/terminal: how to save PATH variable

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.