GNU bug report logs -
#22181
endless loop in grep 2.22
Previous Next
Full log
Message #43 received at 22181 <at> debbugs.gnu.org (full text, mbox):
On Sat, Jan 9, 2016 at 10:20 AM, Paul Eggert <eggert <at> cs.ucla.edu> wrote:
> 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"]}'; }
Indeed, I thought of quotes and backslashes a little too late.
Nice hack. I will use that, probably with an added "local ",
since init.sh ensures that the test-run shell supports that.
Hmm... I see that gnulib's init.sh has a stray (new) use
of local. Will remove.
This bug report was last modified 9 years and 134 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.