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

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

'random' numbers in RLENGTH


From: Lasse Kliemann
Subject: 'random' numbers in RLENGTH
Date: Fri, 16 Mar 2007 14:02:52 +0100

Trustix Secure Linux 3.0.5 running Linux 2.6.19.7.

% gawk --version
GNU Awk 3.1.5

% echo | gawk  '{ match($0, /x*/) ; print RLENGTH ; }'
1208895986
% echo gawk  '{ match($0, /x*/) ; print RLENGTH ; }'
1208429042
% echo | gawk  '{ match($0, /x*/) ; print RLENGTH ; }'
1208584690

...and so on.

% echo a | gawk  '{ match($0, /x*/) ; print RLENGTH ; }'
26
% echo b | gawk  '{ match($0, /x*/) ; print RLENGTH ; }'
26
% echo c | gawk  '{ match($0, /x*/) ; print RLENGTH ; }'
26

% echo x | gawk  '{ match($0, /x*/) ; print RLENGTH ; }'
1

All results, except the last one, should be 0, I presume, as it is the case, 
e.g., with POSIX nawk from the Heirloom Toolchest:

% echo | nawk  '{ match($0, /x*/) ; print RLENGTH ; }'
0

Correct results can also be observed with nawk on Solaris, and with gawk 
3.1.1. on Solaris (which has other bugs, unfortunately).

Switching on POSIX mode in gawk 3.1.5. does not help.


Attachment: pgpFiHLJ2H_oy.pgp
Description: PGP signature


reply via email to

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