From owner-freebsd-current@FreeBSD.ORG Mon Aug 23 12:20:16 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DED7D1065693; Mon, 23 Aug 2010 12:20:16 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id A039F8FC1F; Mon, 23 Aug 2010 12:20:16 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id B25391FFC39; Mon, 23 Aug 2010 12:20:15 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 8875F8452E; Mon, 23 Aug 2010 14:20:15 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: bf1783@gmail.com References: <86mxshdqgh.fsf@ds4.des.no> Date: Mon, 23 Aug 2010 14:20:15 +0200 In-Reply-To: (b. f.'s message of "Fri, 20 Aug 2010 21:07:56 +0000") Message-ID: <86r5hpwmf4.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-current@freebsd.org, gabor@freebsd.org Subject: Re: Official request: Please make GNU grep the default X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 12:20:17 -0000 "b. f." writes: > Dag-Erling Sm=C3=B8rgrav writes: > > "Does not seem to work properly" is not a very useful statement. The > > least you could do is provide an example. > I did provide an example, later in the same sentence that you quoted. I forgot to answer this part. By example, I mean an actual grep command line and sample input that demonstrates the problem, the smaller the better: % echo elisp lisp | grep -w lisp && echo good || echo bad elisp lisp good % echo elisp lisp | grep -wq lisp && echo good || echo bad bad No idea what causes it, but a quick grep (hah!) for qflag turns up the following horror: /* Find out the correct return value according to the results and the command line option. */ exit(c ? (notfound ? (qflag ? 0 : 2) : 0) : (notfound ? 2 : 1)); which shows that -q *does* affect the exit code, but my brain refuses to try to understand that code. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no