Quote:
Originally Posted by mike11
Yes: every login and every new bash terminal window you open.
|
Nope, unless ~/.bashrc is symlinked to either ~/.bash_profile, ~/.bash_login or ~/.profile.
~/.bashrc is only sourced on interactive
non-login shells. As the man page says.
Quote:
There are three files which are supposed to be used in login shells: .bash_profile, .profile and .bash_login . I've found that only .profile is read.
|
These are, as you say, for login shells. In this case ~/.bashrc is not sourced.
They are searched for in this order from the first to the last: ~/.bash_profile, ~/.bash_login, and ~/.profile.
Only the first one found is used. So, if ~/.bash_profile exists and is readable no other file should be sourced, even if ~/.bash_profile is an empty file. So there must be something weird on your system or your files.
Confusion can happen for many things. For example, when people create symlinks from ~/.bashrc to ~/.bash_profile (or any other similar file). Or when people who like to use root all the time create a ~/.bash_profile file in the home of other users. In this case the created file might not be readable and hence it's ignored.