Terry Lambert on 2001-08-11 (Sat) at 12:47:01 -0700:
> Garance A Drosihn wrote:
> > 
> > As to Jason's situation, I also like to use bash as my shell
> > even when I am root.  However, I do not want to muck around with
> > the port for 'bash', or do anything else to move where bash is
> > or how it's built.  So, the way I decided to handle it was to
> > add the following lines in the /root/.login  file:
> > 
> > if ( -x /usr/local/bin/bash ) then
> >     # echo "Switching to bash"
> >     exec /usr/local/bin/bash -login
> > endif
> > 
> > So, strictly speaking /bin/csh is still the default shell for
> > root, but the effect for me is that I automatically get bash
> > whenever I log in.  This seems to work fine for me, and I am
> > not aware of any problems which have been caused by this trick
> > in the few years that I have been using it.
> Add "setenv SHELL /usr/local/bin/bash", and only do your trick
> in the initial interactive login shell, and your logins will
> be faster, and you will get the "right" (for those definitions
> of "right" which include intentional use of "bash" 8-)) shell
> when you shell out of "vi" or other programs.

You may also want to restrict it so that only interactive login sessions
cause bash to be invoked.  To summarise:

  if ( "$tty" != "" ) then
    if ( -x /usr/local/bin/bash ) then
      setenv SHELL /usr/local/bin/bash
      exec /usr/local/bin/bash -login

(There may be a more elegant way to check for shell interactivity in csh, and
if there is I'd like to know about it, please.  :-)

-- V

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to