[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Possible bug in GNU Awk 3.1.1
From: |
Aharon Robbins |
Subject: |
Re: Possible bug in GNU Awk 3.1.1 |
Date: |
Sat, 8 Feb 2003 21:41:21 +0200 |
It is undoubtedly a locale issue. If you change
[a-z]
to
[[:lower:]]
it will probably work. Alternatively, you can put LC_ALL=C in
the environment exported to the awk program.
Arnold
> From: Piotr Wiejak <address@hidden>
> To: address@hidden
> Subject: Possible bug in GNU Awk 3.1.1
> Date: Sat, 8 Feb 2003 16:18:40 +0100
>
> OS = Slackware 8.0
>
> Problem:
> I want to remove all "B" characters followed by lowercase [a-z] char.
>
> Command 1:
> echo "Wielki bB³êkit kB³êbi siê Burza" | awk
> '{gsub("[a-z]B",substr("&",1,1),$0); print $0}'
>
> outputs:
> Wielki bB³êkit kB³êbi siê Burza
>
> Command 2:
> echo "Wielki bB³êkit kB³êbi siê Burza" | awk
> '{gsub("[a-z]B",substr("&",2,1),$0); print $0}'
>
> outputs:
> Wielki ³êkit ³êbi siê Burza
>
> I have no idea why one-character substring is "bB"?
> substr("&",1,1)="bB" ?
>
> Please, help me.
>
> P.Wiejak