bug-gawk
[Top][All Lists]
Advanced

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

Re: [bug-gawk] Fwd: PROCINFO["sorted_in"] in END zone issue


From: arnold
Subject: Re: [bug-gawk] Fwd: PROCINFO["sorted_in"] in END zone issue
Date: Wed, 22 Aug 2012 00:08:22 -0600
User-agent: Heirloom mailx 12.4 7/29/08

Hi. Thanks for sending in a report.

>Denis Shirokov <address@hidden> wrote:
>
> Hi GAWK!
>
> Here is the another one issue (GAWK 4.0.1 Win32):
>
> END{
>       A[1]="A1"; A[2]="A2"; A[3]="A3";
>       PROCINFO["sorted_in"]="_sort"
>       for ( ptr in A ) {
>               print "`" ptr "':`" A[ptr] "'" } }
>
> func  _sort(i1, v1, i2, v2) {
>       return i1 < i2 ? -1 : 1 }
>
>
> Expected output:
>
> `1':`A1'
> `2':`A2'
> `3':`A3'
>
> Actual:
>
> gawk stop executing script and hangs up
>
> This is for END{} zone only and only if PROCINFO["sorted_in"]!="".
> Content of the array A doesn't matter.

As Davide Brini said, this is due to your using an END rule. Gawk is
waiting for input.  If you use a BEGIN rule or give it an end-of-file
indication, you should get output.

Arnold



reply via email to

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