On Wed, Oct 13, 2004 at 07:02:13PM -0400, Christopher Faylor wrote: >Actually, All shells which support -l seem to cd to the home directory. >I'm not sure what the -l adds to the above since the above code just >calls the shell again after cd'ing to the directory.
I think the purpose of that is to ensure that ~/.login (or whatever) gets called to completely set up the shell's environment. Normal shells don't read in that file because they are assumed to inherit their environment from the base login shell. >It almost seems like you could just use ash to invoke the real shell in >all cases. That would be faster. True, you could use any shell as the base login shell which exec's the desired shell. That has the benefit of always working. However, that approach will bypass the login-shell-specific config files for other shell types. For instance, "ash -" will load env vars from ~/.profile rather than ~/.login which a tcsh user is unlikely to have set up to produce identical results (for instance I like to put MANPATH in ~/.login but I don't have a ~/.profile at all). This would result in a "chere" shell which will not behave quite like the user's regular shells, which are spawned from a login shell of the same flavor. Actually that appears to be another bug in the script: chere should invoke ash as "ash -" to start an ash login shell (I haven't tested this though). I think with most login shells the "cd $HOME" behavior is due to the way the scripts are written in /etc (for example Cygwin's /etc/csh.login). That is probably a good thing to have in the script, but it presents a difficulty for this unusual application. -Andy -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/