bug-gawk
[Top][All Lists]
Advanced

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

Re: [bug-gawk] PROCINFO["identifiers"], a bug


From: Neil R. Ormos
Subject: Re: [bug-gawk] PROCINFO["identifiers"], a bug
Date: Tue, 28 Aug 2018 19:32:43 -0500 (CDT)

Petr Slansky wrote:

> Hello,
> 
> I found this by an accident and I think it is a bug in gawk 4.1.3 and 4.1.4
> 
> $ gawk 'BEGIN {for (KEY in PROCINFO) print KEY, PROCINFO[KEY];}'
> group9 116
> ppid 22129
> pgrpid 2890
> api_major 1
> group10 1000
> api_minor 1
> group1 4
> gid 1000
> mpfr_version GNU MPFR 4.0.1
> group2 20
> egid 1000
> group3 24
> gawk: cmd. line:1: fatal: attempt to use array `PROCINFO["identifiers"]' in
> a scalar context
> 
> $ gawk 'BEGIN {print "identifiers" in PROCINFO;}'
> 1
> $ gawk 'BEGIN {print PROCINFO["identifiers"];}'
> gawk: cmd. line:1: fatal: attempt to use array `PROCINFO["identifiers"]' in
> a scalar context
> 
> BTW, note how error is reported, there are two different appostrofes (` &
> '), it looks like other, cosmetic, bug.

PROCINFO["identifiers"] is itself an array.

See the relatively-new Arrays of Arrays feature:

  http://www.gnu.org/software/gawk/manual/html_node/Arrays-of-Arrays.html

and the typeof() and isarray() functions.

Best regards,

--Neil Ormos



reply via email to

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