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

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

Re: Unexpected result while constructing strings


From: Hermann Peifer
Subject: Re: Unexpected result while constructing strings
Date: Sat, 30 Oct 2010 14:55:43 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6

On 30/10/2010 13:13, Davide Brini wrote:

Back to the example, I may be wrong but the only way I see for FS ++c to
evaluate to plain 0 is that for some reason they are grouped as

FS + +c

since c is 0, "+c" is also 0, and the result of the "addition" between FS
and "+c" is 0.

FWIW, mawk shows the same behavior.


Thanks for the pointer to the FAQ. Any idea about this one:

$ gawk-stable/gawk 'BEGIN{ c++ ; print FS ++c }'
01

$ gawk-stable/gawk 'BEGIN{ c++ ; print (FS) ++c }'
 2



reply via email to

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