after installing mac ports my .profile looks like this:

# MacPorts Installer addition on 2011-12-04_at_20:48:26: adding an appropriate PATH variable for use with MacPorts.

export PATH=/opt/local/bin:/opt/local/sbin:$PATH

# Finished adapting your PATH environment variable for use with MacPorts.

But for some reason when opening the terminal, or connecting to the server remotely (ssh) the .profile is not loaded so I can't use macports (unless i go to the macports folder of course).

How can I activate .profile?

link|improve this question
feedback

1 Answer

up vote 3 down vote accepted

From man bash (assuming it is your shell, type echo $0 or echo $SHELL at the prompt to find out):

When bash is invoked as an interactive login shell, [...] 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.

Make sure you don't have either of the first two files, and if you do, add source .login to them. Alternatively, just add the export line to the preferred file.


Other shells probably have similar mechanics of preferring the shell program specific files to the more generic .profile.

link|improve this answer
Thanks a lot, I didn't realize it would only execute the commands in the first file. Added source .profile in my .bash_profile and it works a lot better! Thanks – Erik Dec 10 '11 at 18:52
feedback

Your Answer

 
or
required, but never shown

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