From owner-freebsd-stable Wed Aug 21 6:48:39 2002 Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5A01E37B400 for ; Wed, 21 Aug 2002 06:48:36 -0700 (PDT) Received: from be-well.ilk.org (lowellg.ne.client2.attbi.com [24.147.188.158]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8D90843E42 for ; Wed, 21 Aug 2002 06:48:35 -0700 (PDT) (envelope-from freebsd-stable-local@be-well.no-ip.com) Received: from be-well.ilk.org (lowellg.ne.client2.attbi.com [24.147.188.158]) by be-well.ilk.org (8.12.5/8.12.5) with ESMTP id g7LDmY8u082798 for ; Wed, 21 Aug 2002 09:48:34 -0400 (EDT) (envelope-from freebsd-stable-local@be-well.no-ip.com) Received: (from lowell@localhost) by be-well.ilk.org (8.12.5/8.12.5/Submit) id g7LDmYRA082795; Wed, 21 Aug 2002 09:48:34 -0400 (EDT) X-Authentication-Warning: be-well.ilk.org: lowell set sender to freebsd-stable-local@be-well.ilk.org using -f To: stable@freebsd.org Subject: Re: minor annoyances References: From: Lowell Gilbert Date: 21 Aug 2002 09:48:34 -0400 In-Reply-To: Message-ID: <44k7mktj9p.fsf@be-well.ilk.org> Lines: 22 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Pete French writes: > > If it works, '(aaa &) && bb' can't mean anything other than 'aaa & bb'. > > The "bb" always executes, regardless of the result of "aaa". > > It does ? I would have thought that this would only execute "bb" if the > fork succeeds on the right hand side. That would be a useful feature, but it's never been an intentional one, so it's hard to fault the changes that "broke" it. The standard specifically allows (but does not require) the parent shell to exit if the fork fails, so there's definitely not agreement on the expected behaviour. [This has long been the behaviour that sh follows, by the way.] Some shells explicitly set the return code to 0 after an '&' operator. > How else do you test for fork failing ? Hmm. That never worked anyway, but it's a good idea. I don't know that anyone intended to provide a way to do that. If you were going to make a mechanism from scratch, I'd be inclined toward raising a signal, but this really isn't my area of standards expertise. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message