March 30, 2008

serious geekery

So today I learned how to change your prompt on the Mac OS terminal. At first, I was confused, however, as to why if I ran the bash shell from the Terminal my changes would show up, but if I just clicked on New Shell from Terminal's File menu, they didn't.

Unsurprisingly for Unix, there was a complicated answer, having to do with the difference between two user profile files (which are actually shell scripts). One, .bash_profile, is executed on login (which is why it controls the Terminal settings); the other, .bashrc, is executed when the shell is invoked from inside another shell (or from inside X Windows, apparently, although that doesn't seem to hold true on the Mac).

If you really want to learn more about the difference between .bash_profile and .bashrc, you could read this article. Or you could just type diff .bashrc .bash_profile. </end stupid Unix joke>

Posted by donovan at 10:55 PM | Category: Technology


Comments
Post a comment









Remember personal info?