source .bashrc

my .bashrc is not executed after starting terminal. I have to manually source .bashrc everytime. Is this normal or am I missing something?

Posted on Mar 6, 2012 9:39 PM

Reply
2 replies

Mar 7, 2012 6:17 AM in response to g_wolfman

When starting a new sessions, bash looks for .bash_profile, .bash_login, .profile (in that order) and uses the first one it finds.


If you are already in a session, and start a subshell, then that bash will read .bashrc


This is a way of speeding up the setting of things that are not inherited when starting a subshell.


The typical approach is to have your .bash_profile (or .bash_login, or .profile) source your .bashrc


...
...
...
if [[ -e $HOME/.bashrc ]]; then
    source $HOME/.bashrc
fi
...
...
...

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

source .bashrc

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.