Re: .bashrc not executed

From: stor-sten (stor__sten@hotmail.com)
Date: 04/17/02


From: "stor-sten" <stor__sten@hotmail.com>
Date: Wed, 17 Apr 2002 14:05:10 GMT

I.H.Gregory@herts.ac.uk (Ian Gregory) wrote in
news:slrnabqgpe.fp1.I.H.Gregory@ihg0.herts.ac.uk:

> Robert Morelli wrote:
>
>>Between login and non-login shells, interactive and non-interactive
>>shells, posix and non-posix mode, etc., what the hell is the
>>rationale for all this seemingly pointless complexity? Would I
>>miss out on anything at all if I just set my .bash_profile to the
>>one-line file
>>. ~/.bashrc
>>put everything in .bashrc, and leave ENV and BASH_ENV unset?

I'll give you one example;

if you scp a file to 100 servers, (and thusly have no tty for each
connection) do you want it trying to set tty/prompt/stuff? probably not.
In point of fact, definitly not, unless you enjoy reading error messages.
;)

.bashrc and .bash_profile each have their place. You could view it as
.bashrc is for non-interactive sessions and .bash_profile is for
interactive sessions and you wouldn't be far off the mark.

for example:

if you put this into your .bashrc

stty 38400

and then scp'd something to the host with that .bashrc file, you'd get an
error back regarding stty.

However, if you put that same line into your .bash_profile (not that I'm
recommending this without some /dev/console checking logic) it would work,
and would be a good thing.

The distinction probably doesn't matter to you if you never scp, and/or
you only have <12 servers to deal with.

stor