From owner-freebsd-questions@FreeBSD.ORG Tue Oct 30 23:49:26 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B944216A41B for ; Tue, 30 Oct 2007 23:49:26 +0000 (UTC) (envelope-from bma@gilmour.subvert.org.uk) Received: from jagger.subvert.org.uk (jagger.subvert.org.uk [80.68.88.238]) by mx1.freebsd.org (Postfix) with ESMTP id 793B413C4B3 for ; Tue, 30 Oct 2007 23:49:26 +0000 (UTC) (envelope-from bma@gilmour.subvert.org.uk) Received: from localhost (jagger.subvert.org.uk [127.0.0.1]) by jagger.subvert.org.uk (Postfix) with ESMTP id 77E73382E7 for ; Tue, 30 Oct 2007 23:49:06 +0000 (GMT) Received: from jagger.subvert.org.uk ([127.0.0.1]) by localhost (jagger.subvert.org.uk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4uyAbEeVCTVB for ; Tue, 30 Oct 2007 23:48:58 +0000 (GMT) Received: from gilmour.subvert.org.uk (user-514d9173.l3.c2.dsl.pol.co.uk [81.77.145.115]) (Authenticated sender: bma) by jagger.subvert.org.uk (Postfix) with ESMTP id D6CCB382E6 for ; Tue, 30 Oct 2007 23:48:57 +0000 (GMT) Received: by gilmour.subvert.org.uk (Postfix, from userid 1000) id B5F3FB849; Tue, 30 Oct 2007 23:48:57 +0000 (UTC) Date: Tue, 30 Oct 2007 23:48:57 +0000 From: "Benjamin M. A'Lee" To: freebsd-questions@freebsd.org Message-ID: <20071030234857.GA1186@gilmour.subvert.org.uk> References: <472647A0.3030009@brookes.ac.uk> <20071030130206.GB1178@gilmour.subvert.org.uk> <47279664.1050704@thingy.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <47279664.1050704@thingy.com> User-Agent: Mutt/1.5.16 (2007-06-09) Subject: Re: [freebsd-questions] Dangers of using a non-base shell X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2007 23:49:26 -0000 On Tue, Oct 30, 2007 at 08:39:00PM +0000, Howard Jones wrote: > Benjamin M. A'Lee wrote: >> You could possibly also put "bash -l && exit" in your .shrc, which would >> exit if bash exited successfully. I haven't tested it, but it should >> work. >> > or 'exec bash -l' which will replace the existing shell with bash in > memory, rather than run it from it as a subprocess. I was going to verify > that that's the technical explanation, but 'man exec' gets you the utterly > useless builtin(1) manpage. > > The effect is that you only have to type exit once, anyway. I was going to suggest exec, but if bash then failed to execute, you'd be immediately logged out of sh as well. My suggestion would execute bash if it could, and drop back to sh if bash failed. There may be a better way of doing it, and you can always get a shell prompt some other way if needs be, but this is what works for me. -- Benjamin A'Lee :: benjamin.alee@subvert.org.uk Subvert Technologies :: http://subvert.org.uk/