[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: failure on [a-z] regex at gawk
From: |
Rodrigo Hjort |
Subject: |
Re: failure on [a-z] regex at gawk |
Date: |
Tue, 31 May 2005 09:38:35 -0300 |
Thanks, Stephan!
That was it! I just included "LC_ALL=C" in the top of my script and it worked!
2005/5/31, Stepan Kasal <address@hidden>:
> Hello,
>
> the problem is with locales:
> In UTF-8 locales, the ordering is aAbB...zZ. So the range a-z includes
> all letters but capital Z.
>
> Observe:
> $ LC_ALL=en_GB.utf-8 gawk 'BEGIN{print gensub(/[a-z]+/, "X", "g", "aZalZz")}'
> XZXZX
>
> To fix the issue, add
>
> LC_ALL=C; export LC_ALL
>
> near the top of each shell script which uses awk.
>
> HTH,
> Stepan
>
--
Atenciosamente,
Rodrigo Hjort
address@hidden
http://rhjort.cjb.net/
Linux User #348191 (http://counter.li.org)
"Il y a 10 genres de personnes : ceux qui comprennent des nombres
binaires et ceux qui pas."