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

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

Re: gawk 3.1.5 array question...


From: Jürgen Kahrs
Subject: Re: gawk 3.1.5 array question...
Date: Sat, 29 Apr 2006 19:48:47 +0200
User-agent: Mozilla Thunderbird 1.0.6 (X11/20050715)

Jeff Chua wrote:

        if(x["b"] == "a")    # <== this initializes x["b"] ???
            print "ok";

Yes, this creates the "b" entry of x.
But "ok" is not printed.

This is a bug or a feature? Notice that x["b"] was never defined ...

This is a documented feature.
Testing the existence of x["b"] is done like this:

 if (("b" in x) && x["b"] == "a")
   print "ok"




reply via email to

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