Terminal ignoring .profile when loading new shell

I have this in my .profile:
<pre>export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"</pre>

I have Terminal set to open the default login shell.

This is what happens:
<pre>cmykG5:~ cmyk$ echo $PATH
/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/teTeX/bin/powerpc-apple-darwin-current: /usr/local/mysql/bin:/usr/local/sbin</pre>

And, mind you, this is after I have set the .profile, have quit Terminal and reopened it.
So, it should respect the new Paths I added.

And if I do load the .profile manually:
<pre>cmykG5:~ cmyk$ . .profile
cmykG5:~ cmyk$ echo $PATH
/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/bin:/sbin:/usr/bin:/usr/sbi n:/usr/local/teTeX/bin/powerpc-apple-darwin-current:/usr/local/mysql/bin:/usr/lo cal/sbin</pre>

What's going on?

Message was edited by: Philipp Ringli

G5 2x2.7, Mac OS X (10.5)

Posted on Mar 13, 2009 2:31 AM

Reply
7 replies

Mar 14, 2009 12:05 PM in response to Philipp Ringli

The man page doesn't mention anything about a .profile initialization file. Only a system wide file (/etc/profile).

Sure it does:
... When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable. The --noprofile option may be used when the shell is started to inhibit this behavior. ...

But I'm glad you got your shell initialization working, and that these forums were useful.

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.

Terminal ignoring .profile when loading new shell

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