From owner-freebsd-bugs@FreeBSD.ORG Tue Apr 17 19:20:05 2012 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 420331065742 for ; Tue, 17 Apr 2012 19:20:05 +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 2D7A68FC08 for ; Tue, 17 Apr 2012 19:20:05 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q3HJK4ce092062 for ; Tue, 17 Apr 2012 19:20:04 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q3HJK481092061; Tue, 17 Apr 2012 19:20:04 GMT (envelope-from gnats) Date: Tue, 17 Apr 2012 19:20:04 GMT Message-Id: <201204171920.q3HJK481092061@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: David Wolfskill Cc: Subject: Re: gnu/167009: grep(1): GNU grep -q can exit !0 even if strings found X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: David Wolfskill List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Apr 2012 19:20:05 -0000 The following reply was made to PR gnu/167009; it has been noted by GNATS. From: David Wolfskill To: Jilles Tjoelker Cc: bug-followup@FreeBSD.org Subject: Re: gnu/167009: grep(1): GNU grep -q can exit !0 even if strings found Date: Tue, 17 Apr 2012 12:12:15 -0700 --5V5c01chtBAiSHoy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 17, 2012 at 09:08:12PM +0200, Jilles Tjoelker wrote: > FreeBSD PR gnu/167009: > > [strings -a /usr/local/bin/bison | grep -qw /usr/local fails] >=20 > The peculiar thing is the shell, tcsh. >=20 > What happens is that grep -q terminates early, so that strings receives > SIGPIPE when it tries to write further data. Whereas the exit status > of a pipeline in sh is always the exit status of the last element so > that your command has the expected behaviour, this is different in tcsh. > Tcsh looks backwards for a failing command if the last element has exit > status 0, and returns the 141 corresponding to SIGPIPE. > ... Huh. Thanks for the explanation. :-} Peace, david --=20 David H. Wolfskill david@catwhisker.org Depriving a girl or boy of an opportunity for education is evil. See http://www.catwhisker.org/~david/publickey.gpg for my public key. --5V5c01chtBAiSHoy Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAk+NwI4ACgkQmprOCmdXAD1D9wCeJwFWkjE9cHPAeFSk3x0wTSgf 8wMAnA1SYowMAAcyvF3He4pz9NhkjrcS =UOp+ -----END PGP SIGNATURE----- --5V5c01chtBAiSHoy--