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

RE: differences between telnet and terminal window



Well, sort of :)

But, you seem to be missing the point about the window manager having
(or not) the ENV/BASH_ENV variable set. If your "initial login" is
through a display manager (XDM/GDM/KDM), then there is not necessarily a
"login shell" to get them from, because X is not being started from a
login shell. 

Anyway, the real answer to the original question is still to set the
terminal session to start with the "login shell" option on.

Kevin
-----Original Message-----
From: taroon-list-bounces redhat com
[mailto:taroon-list-bounces redhat com] On Behalf Of Garrick Staples
Sent: Friday, September 03, 2004 11:16 AM
To: Discussion of Red Hat Enterprise Linux 3 (Taroon)
Subject: Re: differences between telnet and terminal window


On Fri, Sep 03, 2004 at 10:46:30AM -0700, Collins, Kevin (KCollins)
alleged:
> Wrong! Take a look at the default /root/.bash_profile and
/root/.bashrc
> - .bashrc explicitly says in the comments:
> 
> # User specific aliases and functions
[..snip manpage..]
> And, since neither ENV or BASH_ENV is set in /etc/profile (but IS set
in
> .bash_profile), by default the .bashrc file will not be sourced be a
new
> terminal session unless the window manager has ENV or BASH_ENV in its
> environment - that depends on how the window manager is started.

Wrong?  It would seem that we agree.

Your initial login, be it /bin/login, ssh, or gdm, will get all the env
variables from your login shell (including ENV or BASH_ENV).  All child
processes will inherit those env variables.  If some child process
happens to
be another shell, it will source the appropriate non-login script and
get your
functions and aliases.

Since login and non-login shells source different files, and you want
the
non-exportable items available in both instances, your .bash_profile
has:

   # Get the aliases and functions
   if [ -f ~/.bashrc ]; then
           . ~/.bashrc
   fi

 
> Kevin
> 
> -----Original Message-----
> From: taroon-list-bounces redhat com
> [mailto:taroon-list-bounces redhat com] On Behalf Of Garrick Staples
> Sent: Friday, September 03, 2004 10:09 AM
> To: Discussion of Red Hat Enterprise Linux 3 (Taroon)
> Subject: Re: differences between telnet and terminal window
> 
> 
> On Fri, Sep 03, 2004 at 09:31:43AM -0700, Collins, Kevin (KCollins)
> alleged:
> > More than likely, the terminal window will be missing things like
> > aliases that are evaluated in a "login", which happens with telnet.
> Most
> > X-terminal apps support a "-ls" (login shell) option that causes
them
> to
> > source the whole environment as if a login were occurring. 
> 
> If that is happening, then the environment is arguable misconfigured.
> Only
> exportable items (environmental variables) should be configured on
> login.  All
> non-exportable items (function definitions, aliases, shell opts, etc),
> should
> be configred in your profile so that all new shells are configured
> correctly.
> 
> When non-exportable items are in your login scripts, then subshells
> can't pick
> these up.
> 
> 
> 
> > -----Original Message-----
> > From: taroon-list-bounces redhat com
> > [mailto:taroon-list-bounces redhat com] On Behalf Of SATISH
RAMANATHAN
> > Sent: Friday, September 03, 2004 9:24 AM
> > To: taroon-list redhat com
> > Subject: differences between telnet and terminal window
> > 
> > 
> > Hi,
> > 
> > This might be a silly question, but how are environments of
> > * a telnet session i.e. a remote login session created by running
> > "telnet 
> > <machine-name>" and
> > * a terminal window i.e. obtained by right clicking on the desktop
> > console 
> > and choosing "New Terminal"
> > different?  Aren't they supposed to be similar?  I am looking at
> > differences 
> > in behavior of my application depending on which mode is used for
> login.
> 
> -- 
> Garrick Staples, Linux/HPCC Administrator
> University of Southern California
> 
> 
> --
> Taroon-list mailing list
> Taroon-list redhat com
> http://www.redhat.com/mailman/listinfo/taroon-list

-- 
Garrick Staples, Linux/HPCC Administrator
University of Southern California



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