|
|
|
|
||||||
| comp.unix.shell Using and programming the Unix shell. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
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 *** |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
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 *** |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
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 |
|
![]() |
| Outils de la discussion | |
|
|