Using .bashrc in Mac OSX
I tried to create some aliases and export some variables I have created by putting them in my .bashrc file whilst using my macbook pro. When I logged out and then back into terminal they were not available to use. I couldn't understand. I did however, find out that Mac OSX is an exception.
Mac OSX loads .bash_profile instead of .bashrc as it runs a login shell by default.
As I want to keep things in my .bashrc you can source this from the .bash_profile. To do this add the following code to .bash_profile.
if [ -f ~/.bashrc ]; then source ~/.bashrc fi
Now you add your variables and aliases to .bashrc just like you would in linux and they are available to use.
Remember you need to log out and back into terminal for it to reload the file.




