Subject: Re: awk(1) RE in FS debacle?
To: None <tlaronde@polynum.com>
From: Jaromir Dolecek <jdolecek@NetBSD.org>
List: tech-userlevel
Date: 07/02/2005 20:44:49
On Sat, Jul 02, 2005 at 12:02:58PM +0200, tlaronde@polynum.com wrote:
> Script started on Thu Jun 30 21:50:35 2005
> jordan% awk 'BEGIN { FS = " *: *"; } { print $1 "|" $2; }'
> 1:2
> 1|2
> 1:21
> 1|2
> 1 :add
> 1|a
> 1a:bdd
> 1a|
> 1a :bdd
> 1a|
> 1a :2dd
> 1a|

This appears to be fixed with newer nawk - the nawk from pkgsrc
doesn't exhibit this problem. I'll look into upgrading the
in-tree nawk to newer version.

Jaromir

> jordan% gawk 'BEGIN { FS = " *: *"; } { print $1 "|" $2; }'
> 1:2
> 1|2
> 1:21
> 1|21
> 1 :add
> 1|add
> 1a:bdd
> 1a|bdd
> 1a :bdd
> 1a|bdd
> 1a :2dd
> 1a|2dd
> jordan% exit
> 
> Script done on Thu Jun 30 21:53:02 2005
> 
> Am I making something completely stupid? Is someone seeing this very
> same behavior? Setting debug level shows that nawk is accepting the 
> correct NF, but the count on characters is definitively wrong (ISTR that
> there were notes in the sources about collapsing sequences and i18n
> causing problems, but this is just a memory).
> 
> If anybody can confirm/infirm and gives some clue.
> 
> TIA
> -- 
> Thierry Laronde (Alceste) <tlaronde +AT+ polynum +dot+ com>
> http://www.kergis.org/  |  http://www.kergis.com/
> Key fingerprint = 0FF7 E906 FBAF FE95 FD89  250D 52B1 AE95 6006 F40C
> 
> -- 
> Thierry Laronde (Alceste) <tlaronde +AT+ polynum +dot+ com>
> http://www.kergis.org/  |  http://www.kergis.com/
> Key fingerprint = 0FF7 E906 FBAF FE95 FD89  250D 52B1 AE95 6006 F40C

-- 
Jaromir Dolecek <jdolecek@NetBSD.org>            http://www.NetBSD.cz/
-=- We can walk our road together if our goals are all the same;     -=-
-=- We can run alone and free if we pursue a different aim.          -=-