MacOS – Terminal app no longer automatically recognizes functions in the ~/.profile any more

bashmacosterminal

I made some function in my ~/.profile to automate things like SSH connections. They were working fine until recently. Now I need to "run" the ~/.profile by doing . .profile each time I open Terminal for my functions to work. How can fix this to make the functions available at start automatically?

I'm running Mountain Lion 10.8.4.

Best Answer

Does ~/.bash_profile exist?

If both ~/.bash_profile and ~/.profile exist, bash reads only ~/.bash_profile when it is invoked as an interactive login shell.

https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html:

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.