From owner-freebsd-questions Thu Feb 25 13:29:52 1999 Delivered-To: freebsd-questions@freebsd.org Received: from alpha.comkey.com.au (alpha.comkey.com.au [203.9.152.215]) by hub.freebsd.org (Postfix) with SMTP id D43A314E50 for ; Thu, 25 Feb 1999 13:29:43 -0800 (PST) (envelope-from gjb@comkey.com.au) Received: (qmail 3333 invoked by uid 1001); 25 Feb 1999 21:27:45 -0000 Message-ID: <19990225212745.3332.qmail@alpha.comkey.com.au> X-Posted-By: GBA-Post 1.04 06-Feb-1999 Date: Fri, 26 Feb 1999 07:27:44 +1000 From: Greg Black To: "Richard E. Hawkins Esq." Cc: Pat Lynch , freebsd-questions@FreeBSD.ORG Subject: Re: csh or bash (newbie) References: In-reply-to: of Wed, 24 Feb 1999 16:37:07 CST Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG [Apologies to anybody who sees this twice. I had a slip of the fingers earlier this morning.] > I would like a .file that, on starting interactively, checks to see > if bash is available, and then executes it, otherwise staying in sh It's not quite clear what you mean. If you mean that you'd like to have your login shell set to sh but that it should check for bash and run that instead, it's trivial. Put the following lines at the top of your ~/.profile file: [ "x$BASH" = "x" ] && [ -x /usr/local/bin/bash ] && SHELL=/usr/local/bin/bash exec /usr/local/bin/bash --login This makes sure that you're not already running bash and then replaces your shell with a bash login shell if it's available. -- Greg Black To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message