bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#22181: endless loop in grep 2.22


From: Paul Eggert
Subject: bug#22181: endless loop in grep 2.22
Date: Sat, 9 Jan 2016 10:20:22 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0

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"]}'; }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]