Log in

No account? Create an account

How do I get Terminal.app not to source .bash_profile? - Open Knowledge — LiveJournal

Nov. 17th, 2006

11:01 am - How do I get Terminal.app not to source .bash_profile?

Previous Entry Share Next Entry

I use bash as my shell. As I understand it, the contents of the .bash_profile should only be executed once, when I login to my account. (The contents of .bashrc are supposed to be sourced every time I launch a new non-login shell.)

However, every time I open a new Terminal.app window on Mac OS X, it sources the contents of both my .bash_profile and .bashrc files. I believe this is because the default Terminal.app preferences are set as follows, "When creating a new Terminal window: Execute the default login shell using /usr/bin/login".

You can change that preference to "Execute this command (specify complete path): /bin/bash" (Where /bin/bash can be the path to any shell you wish). However, even when I change the new window behavior to the latter preference, .bash_profile is still sourced whenever a new terminal window is launched.

Does anyone know how to tell Terminal.app not to source .bash_profile except at login?


[User Picture]
Date:November 17th, 2006 07:15 pm (UTC)
bash --noprofile
(Reply) (Thread)
[User Picture]
Date:November 17th, 2006 07:19 pm (UTC)
Thanks! That worked.
(Reply) (Parent) (Thread)