Running the bash shell: % echo $SHELL /bin/bash % tcsh % echo $SHELL /bin/bash Is SHELL intended to show the original-invocation shell, or the current shell? Reproducible: Always Steps to Reproduce: 1. 2. 3.
defered to experts in bug 35434
works fine for me... % echo $SHELL /bin/tcsh % echo $shell /bin/tcsh
ok, if you fork a tcsh shell from a bash shell, indeed the $SHELL variable is not (re)set. the $shell variable (internal to tcsh) however, is set: pegatoo linux # tcsh (pegatoo:/usr/src/linux) # echo $SHELL /bin/bash (pegatoo:/usr/src/linux) # echo $shell //bin/tcsh otherwise it works like expected. I think this not a Gentoo specific bug, but more normal behaviour. It works the same the other way around (on a non-Gentoo system): (pegasus:current/xquery/runtime) % echo $SHELL /bin/tcsh (pegasus:current/xquery/runtime) % bash bash-3.00$ echo $SHELL /bin/tcsh Judging from this behaviour, I think it shouldn't and this bug can be closed.
This is normal behaviour. Only login shells set the SHELL variable.
I think not the login _shell_, bug the _login_ process should set SHELL variable. the SHELL should contain users' login shell, not anything like "last (login) shell executed". I think this bug is bogus, and that the "setenv SHELL" should disappear from /etc/csh.login. Is user wishes so, he may set SHELL in his ~/.* rc files
(In reply to comment #5) > ... I think this bug is bogus, and that the "setenv SHELL" should > disappear from /etc/csh.login. I believe it is there for compatibility with scripts that rely on $SHELL being defined, while tcsh internally uses $shell for that.
$shell in (t)csh is a local variable, used internally. It has to be set to (t)csh location. $SHELL is environment variable set by login and contains a variable a any program should execute when user wishes to jump to shell (many programs still support shell escape). So, they two have different meanings. Imho none of them should be set by rc script, unless user wishes so (and to his own responsibility). Just my SKK.02 ;)
I'll dig into a few other distros to see what they do, and yank the SHELL = bla thing if none do that. How about that?