[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bash in xterm under x*3.3.2.3a-6




On Mon, 2 Nov 1998, David Welton wrote:

> Make a symlink between bashrc and bash_profile.  Anything else is just
> icky:->

Hmm, AFAIK, either .bash_profile or .bashrc gets sourced at the startup of
a shell.  But .bash_profile is sourced when bash is started as a (new)
login shell and .bashrc only when a subshell is spawned.

I put this in my .bash_profile:

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

This way, I have a general set of definitions and customisation set for
each shell that is started and a separate set of definitions and actions
(like starting fetchmail - if it isn't running already) that get processed
only when I login.  

Ideally, the amount of definitions and (especially) actions in .bashrc
should be held to the bare minimum, as these must be worked over each time
a new shell is started.  When declarations are properly exported to the
environment in .bash_profile, these should remain valid in every later
subshell, so you should not have to deal with them over and over again in
.bashrc.

Regarding xterms, it seems to me that every new xterm should start bash as
a new (sub)shell and not as a separate login.  IMHO you "login" when your
xsession begins.  In line with this philospy, I've added this to the
beginning of my .xsession (which should be linked to .xinitrc AFAIC):

    # source login actions and definitions for this xsession:

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

Cheers,


Joost


Reply to: