nawk Bug?
Khoa Ton
khoa at hpindwa.cup.hp.com
Tue May 14 15:43:39 AEST 1991
I found what seems to be a bug in nawk. The built-in function match (a, b)
is supposed to find regular expression b in string a and return 1 if found
else 0, according to the man page. Match () does not work.
Any help or information would be greatly appreciated.
Khoa Ton
$ what $(which nawk)
/usr/bin/nawk:
$Revision: 64.13.1.1 $
Following are the bug.* files for the command:
$ nawk -f bug.awk bug.in > bug.out
::::::::::::::
bug.awk
::::::::::::::
{
hit= match ($0, "junk");
print $0;
printf ("Hit:%d\tRSTART:%d\tRLENGTH:%d\n", hit, RSTART, RLENGTH);
}
::::::::::::::
bug.in
::::::::::::::
line 1
line 2
line 3
line junk
line 5
line 6
::::::::::::::
bug.out
::::::::::::::
line 1
Hit:-166200 RSTART:-166200 RLENGTH:0
line 2
Hit:-166200 RSTART:-166200 RLENGTH:0
line 3
Hit:-166200 RSTART:-166200 RLENGTH:0
line junk
Hit:1 RSTART:1 RLENGTH:4
line 5
Hit:1 RSTART:1 RLENGTH:4
line 6
Hit:1 RSTART:1 RLENGTH:4
-------------------------------------------------------------------------------
Khoa Ton khoa at hpindno.hp.cup.com
Hewlett-Packard Co.
Cupertino, CA
(408)447-3362
-------------------------------------------------------------------------------
More information about the Comp.unix.shell
mailing list