Afficher un message
Vieux 20/05/2007, 16h51   #4
Barry Margolin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Benefits of login shell

In article <haberg-2005071049170001@c83-250-192-69.bredband.comhem.se>,
haberg@math.su.se (Hans Aberg) wrote:

> In article <barmar-EE5BDC.22234519052007@comcast.dca.giganews.com>, Barry
> Margolin <barmar@alum.mit.edu> wrote:
>
> > > What is the benefit, other than the formal differences, of using a login
> > > shell vs. not using it? - Mac OS X has two consoles, "Terminal" creating a
> > > login shell and 'xterm' not creating it (in 'bash'), both typically opened

> >
> > xterm will create a login shell if you give it the -ls option.
> >
> > > after the GUI login, and it is easy to change it.

> >
> > A login shell will run the .profile startup script to initialize
> > environment variables for the login session.

>
> Thank you, Barry, but those are the formal differences. If I turn off the
> login shell, but otherwise use the same startup (but from a different
> file), will I loose anything?


The point is that some shells don't run ANY startup script automatically
if they're not a login shell. Bash runs the script named in $ENV, but
you usually need to set that variable in another startup script -- it
will then be used by descendant shells.

> [In order to get the Unicode locale working in Terminal, I have in
> Preferences -> Execute this command put
> /usr/bin/env LC_CTYPE=UTF-8 /bin/bash -l
> If I do not want the login shell, I just take away the -l. (In latest
> xterm, it suffices to just put 'export LC_CTYPE=UTF-8' somewhere in the
> startup.)]


If you have an alternate, system-specific way to initialize variables
then you don't need to worry about the login shell distinction. It's
mainly a remnant from the days of ASCII terminals with a single login
session. It's harder to fit into the multi-window modern environment,
where shell windows are not typically descendants of an initial shell
(they usually descend from the window manager).

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
  Réponse avec citation
 
Page generated in 0,06313 seconds with 9 queries