> From: Jim Meyering <[email protected]>
> To: Paolo Bonzini <[email protected]>
> Date: Wed, 05 May 2010 12:05:20 +0200
> Cc: [email protected]
> Subject: Re: [PATCH 2/2] tests: add test for newly-fixed performance problem
>
> Paolo Bonzini wrote:
> > On 05/04/2010 07:32 PM, Jim Meyering wrote:
> >>    $(AWK) 'BEGIN {for (i=0; i<13000; i++) print "aba"}' > in || fail=1
> >
> > Isn't an extra /dev/null needed?
>
> Probably, for some versions of awk, but at least for gawk it's not --
> in that this does not "hang":
>
>     gawk 'BEGIN {for (i=0; i<13000; i++) print "aba"}' > in
>
> To be on the safe side, the test now does this:
>
>     $AWK 'BEGIN {for (i=0; i<13000; i++) print "aba"}' /dev/null > in

For any version of "new" awk, the /dev/null isn't needed. But with
old awk, including the Solaris /usr/bin/awk, it is necessary. In sum,
it doesn't hurt, and it broadens the set of awks for which the code will
work as desired.

HTH,

Arnold


Reply via email to