[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: posiible bug in gawk
From: |
Aharon Robbins |
Subject: |
Re: posiible bug in gawk |
Date: |
Fri, 16 Jul 2010 13:04:53 +0300 |
User-agent: |
Heirloom mailx 12.4 7/29/08 |
Greetings. Re the below.
Thank you for taking the time to send in a report.
It is not a bug, but undoubtedly an issue with your locale. If you do
export LC_ALL=C
before running your program, then things will most likely work the way
you expect. An alternative would be to use [[:upper:]] instead of [A-Z]
and [[:lower:]] instead of [a-z]. This is the best long-term solution.
Thanks,
Arnold
> Subject: posiible bug in gawk
> From: Bernd Klein <address@hidden>
> To: address@hidden
> Date: Thu, 15 Jul 2010 14:59:04 +0200
>
> Hi
>
> I used the following file:
>
> Victory Mansions, though not quickly enough to prevent a swirl of gritty
> dust from entering along with him.
> the
> Bill
> Appendix
> the
>
> Then I started gawk with the following command:
>
> gawk '/^[A-Z]+[a-z]+$/ { print $0" "NR }' bsp.txt
> which delivered the following output:
> the 3
> Bill 4
> Appendix 5
> the 6
>
> This output is incorrect to my mind.
>
> mawk delivers the correct or expected output:
>
> mawk '/^[A-Z]+[a-z]+$/ { print $0" "NR }' bsp.txt
> mawk output:
>
> Bill 4
> Appendix 5
> --
> Bernd Klein
> Pomeziastr. 9
> Tel. 07731/798180