[LUNI] Files executed during logon
glane at frognet.net
Fri Mar 8 15:14:06 CST 2002
On Fri, 2002-03-08 at 14:56, Christopher Young wrote:
> > I believe that login shells read ~/.bashrc only because it is sourced in the
> > default ~/.bash_profile. That's not entirely standard, although it makes
> > sense to me (most of my local setup is in .bashrc - I think the original
> > motivation was that xterms weren't starting bash as at a login, and so would
> > have annoyingly different setup than the console. something like that...)
> I'm not exactly sure if I understand what you are saying above.
> However, let me state what I have just observed with X and see if it
> If I change my .bash_profile and then start a new xterm, I do not see
> the changes I've made in my environment within the .bash_profile.
.bash_profile is sourced on a login shell.
> However if I put the changes in my .bashrc, I do, in fact, see the
> changes when I launch a new xterm.
.bashrc is sourced on a non-login shell.
Bash has a switch '--login' that will make it act as if it were the
> My .bash_profile does call .bashrc, if it exists, but it appears that
> .bashrc is also called by a launched xterm and not solely from
In this case a login shell will get everything from the .bashrc file
(because .bash_profile sources .bashrc), but non-login shells will not
get things from .bash_profile.
By the way all of this is in the bash man page under the 'Invocation'
Geoff Lane <glane at frognet.net>
Recursive adj. See Recursive.
PGP Key: http://www.frognet.net/~glane/key.html
More information about the luni