I’ve been spending a great deal of time with BASH lately and I’m confused about best practices on the mac. I found this helpful article.
Why two different files?
Say, you’d like to print some lengthy diagnostic information about your machine each time you login (load average, memory usage, current users, etc). You only want to see it on login, so you only want to place this in your .bash_profile. If you put it in your .bashrc, you’d see it every time you open a new terminal window.
Another thing to keep in mind is that MAC OSX keeps it’s .bashrc file (located at ~/.bashrc on linux/unix) in a file located at /etc/bashrc
source .bashrc or
source .bash_profile will switch back and forth
This post has a nice table of escaped special characters you can use in your prompt. https://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html
Also helpful is the sequence in which MacOSX and unix look for bash setup files and how to set up an if statement http://apple.stackexchange.com/questions/119711/why-doesnt-mac-os-x-source-bashrc