bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: Semicolon is not treated properly in awk 3.1.4


From: Chapman Flack
Subject: Re: Semicolon is not treated properly in awk 3.1.4
Date: Mon, 13 Sep 2004 11:42:57 -0500

Are you sure it is not a length() or substr() bug, rather than a (less likely)
bug specific to semicolons?  Notice that the lines you give as input to awk
differ between the two examples below; in the second example there is no
semicolon on the first line of input.  The second example behavior is
therefore consistent with an interpretation that length() or substr() is
simply off by one, nothing to do with semicolons.

-Chap

> zardoz 3 % awk '{ print substr($0, 0, length($0) - 6) } '
> JavaMonitorImpl_2_fire_4983_code;
> JavaMonitorImpl_2_fire_4983
> JavaMonitorImpl_2_fire_4983_code\;
> JavaMonitorImpl_2_fire_4983_
> 
> The following happens on 3.1.4 (Debian Linux):
> 
> address@hidden:[snip]$ awk '{ print substr($0, 0, length($0) -  6) } '
> JavaMonitorImpl_2_fire_4983_code
> JavaMonitorImpl_2_fire_49
> JavaMonitorImpl_2_fire_4983_code\;
> JavaMonitorImpl_2_fire_4983




reply via email to

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