Bug 528625 - awk syntax support
Summary: awk syntax support
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: gawk
Version: 12
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Jan Zeleny
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 607916
TreeView+ depends on / blocked
 
Reported: 2009-10-13 06:43 UTC by Yang Ren
Modified: 2010-11-13 21:57 UTC (History)
4 users (show)

Fixed In Version: gawk-3.1.8-1.fc13
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 607916 (view as bug list)
Environment:
Last Closed: 2010-07-01 18:37:05 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Yang Ren 2009-10-13 06:43:20 UTC
Description of problem:
This may same as Bug 528623

(index in array1) in array2
should means if 1 or 0 existed in array2

Version-Release number of selected component (if applicable):
gawk-3.1.7-1.fc12.x86_64

How reproducible:
Always

Steps to Reproduce:

cat << "EOF" > file
Beth 4.00 0
EOF
cat << "EOF" > prog
{
B["c","a"] = 2
A[1] = 4
print ("c","a") in B in A
print C in B in A
}
EOF
awk -f prog file > awk.stdout
cat awk.stdout
  
Actual results:
awk: prog:4: print ("c","a") in B in A
awk: prog:4:                 ^ syntax error

Expected results:
1
0

Additional info:

Comment 1 Bug Zapper 2009-11-16 13:35:10 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 12 development cycle.
Changing version to '12'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 2 Jan Zeleny 2010-05-27 15:28:56 UTC
As for the second mentioned bug:

I don't see this as an error. Operator "in" returns logical value, thus its result (C in B) shouldn't be looked up in A. (or to be precise, it could be, but it makes no sense to me).

Do you have any manual reference saying this should be possible? Did you report this upstream? I didn't notice any mail in their mailing list regarding this. I certainly won't change this behavior without upstream supporting it.

Comment 3 Jan Zeleny 2010-06-04 09:43:21 UTC
If you insist on behaviour you wrote, please contact upstream developers and consult it with them, maybe they will consider this. But from my point of view current behavior is logical and intentional, so I won't implement other one. I'm closing this bug.

Comment 4 Ulrich Drepper 2010-06-15 01:14:38 UTC
It is a bug as you can see when you use a one-dimensional array B instead of a two-dimensional.

I've contacted the upstream maintainer and expect it to be fixed there.  A patch should then be backported.

Comment 7 Fedora Update System 2010-06-25 10:02:13 UTC
gawk-3.1.8-1.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/gawk-3.1.8-1.fc13

Comment 8 Fedora Update System 2010-06-25 18:19:48 UTC
gawk-3.1.8-1.fc13 has been pushed to the Fedora 13 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update gawk'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/gawk-3.1.8-1.fc13

Comment 9 James Laska 2010-06-30 14:39:12 UTC
Using the reproducer from comment#0, I confirmed that the problem is resolved with gawk-3.1.8-1.fc13  

$ rpm -q gawk
gawk-3.1.8-1.fc13.x86_64

$ cat << "EOF" > prog
{
B["c","a"] = 2
A[1] = 4
print ("c","a") in B in A
print C in B in A
}
EOF

$ awk -f prog file > awk.stdout
$ cat awk.stdout 
1
0

Comment 10 Fedora Update System 2010-07-01 18:36:55 UTC
gawk-3.1.8-1.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 11 Fedora Update System 2010-11-02 15:37:34 UTC
gawk-3.1.8-3.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/gawk-3.1.8-3.fc14

Comment 12 Fedora Update System 2010-11-13 21:57:40 UTC
gawk-3.1.8-3.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.