From owner-freebsd-current Tue Aug 14 4:24: 2 2001 Delivered-To: freebsd-current@freebsd.org Received: from fling.sanbi.ac.za (fling.sanbi.ac.za [196.38.142.119]) by hub.freebsd.org (Postfix) with ESMTP id 97E5437B401 for ; Tue, 14 Aug 2001 04:23:55 -0700 (PDT) (envelope-from johann@egenetics.com) Received: from johann by fling.sanbi.ac.za with local (Exim 3.13 #4) id 15WcIO-0009eq-00; Tue, 14 Aug 2001 13:23:40 +0200 Date: Tue, 14 Aug 2001 13:23:40 +0200 From: Johann Visagie To: Garance A Drosihn Cc: freebsd-current@FreeBSD.ORG Subject: Re: bash in /usr/local/bin? Message-ID: <20010814132340.B36548@fling.sanbi.ac.za> References: <3B74D180.D036D629@hway.net> <20010810233635.A12077@xor.obsecurity.org> <3B758BB5.D529AA5F@mindspring.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <3B758BB5.D529AA5F@mindspring.com>; from tlambert2@mindspring.com on Sat, Aug 11, 2001 at 12:47:01PM -0700 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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