From owner-freebsd-bugs Sun Oct 6 07:12:07 1996 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id HAA17624 for bugs-outgoing; Sun, 6 Oct 1996 07:12:07 -0700 (PDT) Received: from linkdead.paranoia.com (linkdead.paranoia.com [204.145.225.245]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id HAA17587 for ; Sun, 6 Oct 1996 07:12:01 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by linkdead.paranoia.com (8.7.5/8.7.3) with SMTP id JAA08243 for ; Sun, 6 Oct 1996 09:08:23 -0500 (CDT) Message-Id: <199610061408.JAA08243@linkdead.paranoia.com> X-Authentication-Warning: linkdead.paranoia.com: Host localhost [127.0.0.1] didn't use HELO protocol To: freebsd-bugs@freebsd.org Subject: /bin/sh fix for ya Date: Sun, 06 Oct 1996 09:08:22 -0500 From: VaX#n8 Sender: owner-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk how-to-repeat: /bin/sh -ec 'false && true; echo hi' this conflicts with: -e errexit If not interactive, exit immediately if any untested command fails. The exit status of a command is considered to be explicitly tested if the command is used to control an if, elif, while, or until; or if the command is the left hand operand of an ``&&'' or ``||'' operator. PS: Thanks for letting me (well, anyone) use the cool CVS tree website. It's fairly convenient in some cases (other times I wish I had full shell/CVS access but oh well). I "fixed" a few things in NetBSD with your changes. ...OS hacking without prejudice.... the VaX#n8er... fix: --- ../sh.netbsd/eval.c Tue Jun 11 06:14:10 1996 +++ eval.c Sun Oct 6 08:43:15 1996 @@ -207,8 +207,11 @@ break; case NAND: evaltree(n->nbinary.ch1, EV_TESTED); - if (evalskip || exitstatus != 0) + if (evalskip || exitstatus != 0) { + /* don't bomb out on "set -e; false && true" */ + flags |= EV_TESTED; goto out; + } evaltree(n->nbinary.ch2, flags); break; case NOR: