bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: gawk bug


From: Aharon Robbins
Subject: Re: gawk bug
Date: Sun, 30 Sep 2001 11:17:49 +0200

Dr. McIlroy,

Greetings.  Re this:

> This gawk program produces no output for any input
>       gawk '{print $1>0}'
> but this one does
>       gawk '{print ($1>0)}'
> I am running gawk version 3.0.6
>
> Doug McIlroy

If you look in your current directory, you will find a file named "0"
with your data in it.  Gawk parses the '>' at the end of the print as
a file redirection.

I don't believe there's an easy way to change this without doing severe
damage in the grammar, and I'm loathe to try it; Brian Kernighan has
bemoaned to me before about his own problems in trying to parse this
"correctly".  (Proof by name dropping, but his awk does the same thing
as gawk does.)

FYI, you will find a number of new and interesting features in gawk 3.1.0,
including line-count profiling; you might want to check it out.

Thanks,

Arnold Robbins



reply via email to

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