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

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

pgawk: wrong execution counts


From: Hermann Peifer
Subject: pgawk: wrong execution counts
Date: Tue, 15 Jun 2010 14:17:50 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4

Hi Arnold,

I noticed some wrong execution counts, see the first pgawk run below.

After hanging the rule from /^Tue/{++c} to $0~/^Tue/{++c}, the counts are correct.

Hermann

address@hidden:clc]> cat testdata
Tue Jun 15 12:03:00 CEST 2010
Tue Jun 15 12:13:28 CEST 2010
Tue Jun 15 12:17:08 CEST 2010
Tue Jun 15 12:23:50 CEST 2010
Tue Jun 15 12:33:07 CEST 2010
Tue Jun 15 12:41:41 CEST 2010
Tue Jun 15 12:45:24 CEST 2010
Tue Jun 15 12:48:58 CEST 2010
Tue Jun 15 12:52:37 CEST 2010
Tue Jun 15 12:56:44 CEST 2010

$ pgawk '/^Tue/{++c}' testdata && cat awkprof.out
        # gawk profile, created Tue Jun 15 14:11:14 2010

        # Rule(s)

    10  /^Tue/  { # 3
    10          ++c
        }

$ pgawk '$0~/^Tue/{++c}' testdata && cat awkprof.out
        # gawk profile, created Tue Jun 15 14:11:36 2010

        # Rule(s)

    10  $0 ~ /^Tue/     { # 10
    10          ++c
        }

$ pgawk --version | head -1
GNU Awk 3.1.8




reply via email to

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