From owner-freebsd-bugs@FreeBSD.ORG Thu Jan 8 12:30:02 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F7C4106566C for ; Thu, 8 Jan 2009 12:30:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 4BCC18FC1E for ; Thu, 8 Jan 2009 12:30:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n08CU2Bd058321 for ; Thu, 8 Jan 2009 12:30:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n08CU2qv058320; Thu, 8 Jan 2009 12:30:02 GMT (envelope-from gnats) Resent-Date: Thu, 8 Jan 2009 12:30:02 GMT Resent-Message-Id: <200901081230.n08CU2qv058320@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Martin Beran Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CDF81065672 for ; Thu, 8 Jan 2009 12:21:06 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 5B0038FC13 for ; Thu, 8 Jan 2009 12:21:06 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n08CL5m5094808 for ; Thu, 8 Jan 2009 12:21:05 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id n08CL5J9094796; Thu, 8 Jan 2009 12:21:05 GMT (envelope-from nobody) Message-Id: <200901081221.n08CL5J9094796@www.freebsd.org> Date: Thu, 8 Jan 2009 12:21:05 GMT From: Martin Beran To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: bin/130298: /bin/sh does not handle negation correctly in complex commands X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jan 2009 12:30:02 -0000 >Number: 130298 >Category: bin >Synopsis: /bin/sh does not handle negation correctly in complex commands >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Jan 08 12:30:01 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Martin Beran >Release: 7.0-RELEASE-p6 >Organization: Trusted Network Solutions, a. s. >Environment: FreeBSD mb.tns.cz 7.0-RELEASE-p6 FreeBSD 7.0-RELEASE-p6 #2: Wed Nov 26 09:21:51 CET 2008 root@mb.tns.cz:/usr/obj/usr/src/sys/MB i386 >Description: Negation of a pipeline exit status (the shell construct ! cmd1 | cmd2) does not work when joined with another command by &&: cmd3 && ! cmd1 | cmd2. The exit status is the same as in: cmd3 && cmd1 | cmd2. Using braces triggers the correct behavior: cmd3 && { ! cmd1 | cmd2; }. >How-To-Repeat: true && ! true | true; echo $? This should display 1 (as it does, for example, in bash), but displays 0. >Fix: true && ! true | true; echo $? >Release-Note: >Audit-Trail: >Unformatted: