PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > comp.unix.shell > Benefits of login shell
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.unix.shell Using and programming the Unix shell.

Benefits of login shell

Réponse
 
LinkBack Outils de la discussion
Vieux 19/05/2007, 17h29   #1
Hans Aberg
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Benefits of login shell

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
after the GUI login, and it is easy to change it.

Hans Aberg
  Réponse avec citation
Vieux 20/05/2007, 03h23   #2
Barry Margolin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Benefits of login shell

In article <haberg-1905071829240001@c83-250-192-69.bredband.comhem.se>,
haberg@math.su.se (Hans Aberg) 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.

--
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
Vieux 20/05/2007, 09h49   #3
Hans Aberg
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Benefits of login shell

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?

[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.)]

Hans Aberg
  Réponse avec citation
Vieux 20/05/2007, 15h51   #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
Vieux 20/05/2007, 16h08   #5
Hans Aberg
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Benefits of login shell

In article <barmar-2C673F.10513120052007@comcast.dca.giganews.com>, Barry
Margolin <barmar@alum.mit.edu> wrote:

> > 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.


OK. Fine.

> 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).


There is such a method on Mac OS X: one can use a file
~/.MacOSX/environment.plist.

I just compiled that latest C-version of Modules <comp.sys.mac.system>
under Mac OS 10.4.9 (latest). All I had to do is to add an option '-lX11'
to the last gcc linking command, which otherwise fails. I haven't checked
if it works, though.

Hans Aberg
  Réponse avec citation
Vieux 20/05/2007, 21h15   #6
Hans Aberg
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Benefits of login shell

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.


Detail: One can start X Window programs without a console, for example
from the X11 "File" menu, in which case .bashrc will be executed, not
..profile. So this lessens the point of making xterm a login shell.

Hans Aberg
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 13h25.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,12541 seconds with 14 queries