Many people wrote:
[about login shells etc...]
I've followed this thread with great interest. So far I've not run into
problems, mostly because I don't have complicated setups.
Summary:
There are 4 types of shells:
interactive non-interactive
Login classical 'login shell' [1]
non-login xterm etc... (yes, being executing something
disputed) (shell script, ...)
[1]
Should this occur?
Isaac To <kkto@csis.hku.hk>:
> If you get a shell using ssh, you should get a login shell---no matter
> whether the shell executed by your ssh session is used just for one
> program or for many programs
So ssh <host> <somecmd> should invoke <somecmd> from a login shell?
So far, I think, it is relatively clear. Confusion starts because the
login process could be started by something other than a shell, so there
could be non-login shells without a login shell ancestor. Especially,
and obviously, X.
> .xsession (or whatever): should really source .xinitrc after setting
> the environment.
> .xinitrc: everything that you want to appear everytime you see X
> .profile: should really source .bashrc after setting the environment.
> .bashrc: everything that you want to happen in every interactive bash
> instance.
> .login: should really source .cshrc after setting the environment.
> .tcshrc: everything that you want to happen in every tcsh instance.
Excellent summary! Thanks.
I think that the x session script should take care to include the
.profile, so that the login setup is executed properly. (Does it do this
currently? grep profile /etc/X11 does not give anything.)
So, I guess, the confusing bits are:
At the top of the default .bashrc:
---
~/.bashrc: executed by bash(1) for non-login shells.
...
# If running interactively, then:
---
which suggests that .bashrc is also read for non-interactive shells (it
usually isn't), and fails to mention that with the default configuration
it is also read for login shells from .bash_profile.
cheers
-- vbi
--
secure email with gpg http://fortytwo.ch/gpg
Attachment:
signature.asc
Description: This is a digitally signed message part