Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Aug 2001 13:23:40 +0200
From:      Johann Visagie <johann@egenetics.com>
To:        Garance A Drosihn <drosih@rpi.edu>
Cc:        freebsd-current@FreeBSD.ORG
Subject:   Re: bash in /usr/local/bin?
Message-ID:  <20010814132340.B36548@fling.sanbi.ac.za>
In-Reply-To: <3B758BB5.D529AA5F@mindspring.com>; from tlambert2@mindspring.com on Sat, Aug 11, 2001 at 12:47:01PM -0700
References:  <3B74D180.D036D629@hway.net> <20010810233635.A12077@xor.obsecurity.org> <p0510100fb79b2a85857c@[128.113.24.47]> <3B758BB5.D529AA5F@mindspring.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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
    endif
  endif

(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 majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010814132340.B36548>