GNU bug report logs - #22181
endless loop in grep 2.22

Previous Next

Package: grep;

Reported by: Christian Boltz <grep-bug <at> cboltz.de>

Date: Tue, 15 Dec 2015 20:47:01 UTC

Severity: normal

Done: Jim Meyering <jim <at> meyering.net>

Bug is archived. No further changes may be made.

Full log


Message #40 received at 22181 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Jim Meyering <jim <at> meyering.net>
Cc: Christian Boltz <grep-bug <at> cboltz.de>, 22181 <at> debbugs.gnu.org,
 Seth Arnold <seth.arnold <at> canonical.com>
Subject: Re: bug#22181: endless loop in grep 2.22
Date: Sat, 9 Jan 2016 10:20:22 -0800
Jim Meyering wrote:
> Hah! TIL head -N and yes are not portable. Thank you.
> I've been spoiled/corrupted by writing coreutils tests for so long.
>
> I would prefer to continue to use "yes" via the following, at least
> in the first test. That way is clearer. In the second, I could go either
> way, since your awk process replaces both yes and head, at the
> expense of being a bit less concise and less readable.

I could go either way too.

Though it's not needed for these particular tests, the shell function can be 
tweaked to default to 'y' and to output quotes and backlashes in the arg as-is, 
like BSD 'yes'.  Something like this, perhaps?

yes() { line=${*-y} ${AWK-awk} 'BEGIN{for (;;) print ENVIRON["line"]}'; }




This bug report was last modified 9 years and 133 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.