== When bash sources your _.bashrc_ Since I just looked up the rules on when bash sources your _.bashrc_ (and did some testing), here's the rules on what gets sourced when, for reasonably current versions of bash. Making this more confusing is that bash apparently uses heuristics for some of its decisions. * login shells do not source your _.bashrc_; they source only your profile (bash looks at various names, but I just use _.profile_). * non-login interactive shells source your _.bashrc_. * shells started by ssh to run remote commands should source your _.bashrc_, assuming that bash got its heuristics right to recognize that this was happening. * otherwise, non-interactive shells (such as those running scripts) do not source _.bashrc_. (Non-login interactive shells are common in today's environments, because there are now a lot of things that start new shell sessions without bothering to make them login shells; examples include the various X terminal emulators (_xterm_ et al) and _screen_. In fact in some environments all of your shells will be non-login interactive shells, and you won't really have a login shell as such.) Various command line arguments can influence bash's idea of what its environment is, or explicitly suppress bits of this; see _--login_, _--noprofile_, and _--norc_. Since shell options only affect the current shell, they need to be set in your _.bashrc_ so that they affect non-login interactive shells. Environment variables such as _$PATH_ could theoretically go in your profile and be inherited by subshells, but most people put them in their _.bashrc_ too and just have their profile source their _.bashrc_. Plus, this is the easiest way to alter your _$PATH_ to make things like '_ssh host private-command_' work. (On some systems this is quite important, because _rsync_ is not on the default _$PATH_. Solaris 10 is one example of this.) As far as I can see, bash provides no clear sign about what sort of environment the shell session is running in. If this matters, you are left to deduce things through various signs, none of which are necessarily entirely accurate. (This issue came up here recently, as we were trying to work out what we needed in _.bashrc_ and why on our Solaris 10 machines. No one could remember exactly what had to be where.)