bug-gawk
[Top][All Lists]
Advanced

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

Re: print: unexpected gawk's behaviour in case indirect function call


From: Ed Morton
Subject: Re: print: unexpected gawk's behaviour in case indirect function call
Date: Wed, 2 Feb 2022 08:17:38 -0600
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.5.1

same behavior with gawk 5.1.0 in bash on cygwin:

$ awk -f tst.awk | cat -Ev
DIRECT:   1$
match1$
END$

$ awk --version
GNU Awk 5.1.0, API: 3.0 (GNU MPFR 4.1.0, GNU MP 6.2.1)
Copyright (C) 1989, 1991-2020 Free Software Foundation.


On 2/2/2022 7:16 AM, Denis Shirokov wrote:
Hi Gawk Team!

i found strange gawk's behaviour that is completely makes me crazy

example:

       BEGIN{

             print "DIRECT:   "      match( a, b )


             f = "match"

             print "INDIRECT: "      @f( a, b )


             print "END" }

output:

       D:\CPU\DEV\PROJECT\XASM>gawk -f ./a.txt
       DIRECT:   1
       match1
      < 'match' ??? wtf?
       END

it's looks like it's lost leading "INDIRECT: " string and then outputs
content of the
globvar `f: "match" and THEN indirectly call built-in match() function
and output it's
result.

please note that this behaviour was found while reporting about
another gawk issue that's will be reported soon. the provided example
is from there,

Windows 10(x64)
GNU Awk 5.1.1, API: 3.1 (GNU MPFR 4.0.2, GNU MP 6.1.2)

Kind Regards
Denis



reply via email to

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