[Bug 7226] New: awk parsing bug
bugzilla at busybox.net
bugzilla at busybox.net
Tue Jun 24 15:17:13 UTC 2014
https://bugs.busybox.net/show_bug.cgi?id=7226
Summary: awk parsing bug
Product: Busybox
Version: unspecified
Platform: PC
OS/Version: Linux
Status: NEW
Severity: minor
Priority: P5
Component: Other
AssignedTo: unassigned at busybox.net
ReportedBy: charles.fisher at alcoa.com
CC: busybox-cvs at busybox.net
Estimated Hours: 0.0
The following runs successfully with gawk:
BEGIN { print "Enter some stuff, stop with . (dot):\n"
while(getline) if($1 == "." && NF == 1) break; else list[i++] = $0
for(j=0; j<i; j++) print list[j] }
It fails in busybox with:
$ /sbin/busybox awk -f testcase.awk
awk: testcase.awk:3: Unexpected token
If I adjust the script to the following, it will run properly:
BEGIN { print "Enter some stuff, stop with . (dot):\n"
while(getline) if($1 == "." && NF == 1)
{ break }
else list[i++] = $0
for(j=0; j<i; j++) print list[j] }
I have found this behavior on Oracle Linux 5.10 Busybox version 1.2.0, and
Mingw-Win32 Busybox version v1.23.0-TIG-1525-ge19594c
--
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the busybox-cvs
mailing list