Re: Official request: Please make GNU grep the default

From: Dag-Erling Smørgrav <des_at_des.no>
Date: Mon, 23 Aug 2010 14:20:15 +0200
"b. f." <bf1783_at_googlemail.com> writes:
> Dag-Erling Smørgrav <des_at_des.no> 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
-- 
Dag-Erling Smørgrav - des_at_des.no
Received on Mon Aug 23 2010 - 10:20:16 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:06 UTC