I'm using Mac OS X Snow Leopard. Which folder do I create my .profile file in?
I like to create a path for /usr/local/mysql/bin – any tips on how to export this path? I only know how to type it for .bash_profile.
You create .profile in the same folder as .bash_profile, namely in /Users/your-user-name/ also available under ~ or $HOME.
You can add the line using a text editor or command line editor of your choice (like vim, emacs or nano), but you can also do it with Text Edit:
open -a TextEdit ~/.bash_profile
export command?One important thing: If you already have a .bash_profile, your .profile will not be loaded automatically. From bash's manual:
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.
Because of that, when you already have a ~/.bash_profile file and create a ~/.profile, the latter will never be read by bash automatically. You can add the appropriate export command in your ~/.bash_profile and it will work just fine if you always use bash:
export PATH=/usr/local/mysql/bin/:$PATH
.profile from .bash_profileIf you want to have a separate .profile, you need to manually include it from ~/.bash_profile. Put the following in ~/.bash_profile:
source ~/.profile