Showing posts with label bashrc. Show all posts
Showing posts with label bashrc. Show all posts

Wednesday, September 14, 2011

OSx and the bashrc

A couple of months ago I purchased my first Mac, a 13" Macbook Pro.  I have to say that I am absolutely loving so far.  The interface is pretty sweet, but for me the best part is that its got a *nix back end.  Learning a new environment like OSx after coming from the Linux world is not a difficult transition, but it certainly has its little speed bumps.

This evening was one such speed bump when I decided to add some things and customize my .bashrc.  The first thing I noticed….. there wasn't a .bashrc in existence yet on the system.  This simply told me that it was pulling its initial settings from /etc/profile (which in turn sources /etc/bashrc on OSx Lion).

So, I went and created my own .bashrc in my home directory, added my settings that I liked to have and copied some of the stuff from the default /etc/bashrc file.  I then saved the file and sourced it with ". ./.bashrc" to test the settings and ensure I didn't break anything.  Cool, all looked to be fine.  I closed the window, opened another one and that is when I noticed that the changes I made were non-existent.

So, I did a little bit of Google digging and quickly learned that by default, OSx looks for the .bash_profile, not the .bashrc file.  That is a bit of a change from Linux as it does look for the .bashrc.  To not look for it is a bit ludicrous in my opinion (as rc files are the most common settings files in the *nix world), but this is not a standard *nix platform.  So, I did what any geek would do and created a soft link for .bash_profile that pointed to my .bashrc that I had just created.  Yes, I just created it and was going to be damned if Apple was going to tell me I couldn't use it.  Call me stubborn, but its my environment, not theirs.

So, after that little speed bump, I need only edit my .bashrc and resource to have my changes take effect.  Now, on to see what other funky differences I can discover.
 
Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 License.