Using .bashrc in Mac OSX

warning: realpath() [function.realpath]: SAFE MODE Restriction in effect. The script whose uid/gid is 751/751 is not allowed to access /tmp owned by uid/gid 0/0 in /home/opengov1/public_html/www.matsearle.com/includes/file.inc on line 190.

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.

© 2011 Creation Web Design. Website Designed & Built by Creation Web Design.