[CLUE-Tech] Login shell w/ SSH

Timothy C. Klein teece at silverklein.net
Wed Jan 15 01:00:24 MST 2003


* Matt Gushee (mgushee at havenrock.com) wrote:
> On Tue, Jan 14, 2003 at 09:16:48PM -0700, Jeffery Cann wrote:
> > On Tuesday 14 January 2003 05:07 pm, Matt Gushee wrote:
> > > What do I need to do to have .bashrc invoked when I log in over SSH?
> > 
> > Rename it or create a soft link to a file called ~/.bash_profile.  AFAIK, 
> > .bashrc will not be run as a login shell.  I use this setup successfully via 
> > ssh.
> 
> Well, kind of. But aren't .bashrc and .bash_profile supposed to do
> different things? Admittedly, it has never been totally clear to me what
> exactly the distinction is supposed to be, but I have always had both.
> 
> Anyway, you prompted me to look at the .bash_profile that was already
> there, and I found:
> 
> #if [ -f ~/.bashrc ]; then
> #    source ~/.bashrc
> #fi
> 
> Aha! Commented out! Apparently it was installed that way, though I'm not
> sure why. And for some reason it seems kind of backwards to have
> .bash_profile invoke .bashrc ... I guess the names suggest that .bashrc
> is "more active."
> 

I think the idea is this: .bash_login will do the things that only need
to be done when you first log into the system. .bashrc will do the stuff
that you need to have for your day to day use on every instance of bash.
Every bash instance should use .bashrc, but every instance does not have
to use .bash_login.

A brand new ssh connection would call .bash_login.  I have alwasys had
the login file call the rc file.  If you were to launch a subshell, that
would only source .bashrc.  

The only thing extra my bash_login file does is check for fetchmail, if
it is not running, it starts it.

Tim
--
==============================================
==  Timothy Klein || teece at silverklein.net  ==
==  http://i148.denver.dsl.forethought.net  ==
== ---------------------------------------- ==
== "Hello, World" 17 Errors, 31 Warnings... ==
==============================================



More information about the clue-tech mailing list