[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug-Report
From: |
Aharon Robbins |
Subject: |
Re: Bug-Report |
Date: |
Mon, 25 Sep 2006 22:10:12 +0300 |
Greetings.
This is undoubtedly a locale issue. If you use
export LC_ALL=C
at the shell level, things should behave as you expect.
Alternatively, you can use the POSIX bracket expressions to
express the character types
/[[:alpha:]]/ # alphabetic characters
/[[:lower:]]/ # lowercase
/[[:upper:]]/ # uppercase
/[[:digit:]]/ # digits
and things should also work as you expect.
See the gawk manual.
Thanks,
Arnold
> Date: Sun, 24 Sep 2006 03:04:01 +0800
> From: DsangWonFan <address@hidden>
> Subject: Bug-Report
> To: address@hidden
>
> Greeting:
>
> There is something wrong with gawk 3.1.4. While using some regular
> expressions such as /[1-9]/,
> /[a-z]/, or/[A-Z]/, as a pattern ,the gawk 3.1.4 often makes mistakes.
> For examples, let's suppose there is a file named "temp", and what
> "temp" contains is:
>
> 1234
> 4567
> acpi
>
> i.e. when you execute the command "cat temp" the result of which is:
>
> 1234
> 4567
> acpi
>
> But unfortunately, if we execute a command like this "gawk '{if($0 ~
> /[1-9]/){print $0;}}' temp" ,
> the result is:
>
> 1234
> 4567
> acpi
>
> In fact, the "acpi" shall not be printed!
>
> The version of the compiler which I employed to compile gawk 3.1.4 is
> gcc (GCC) 3.3.5 (Debian 1:3.3.5-13).
>
> Sincerely Yours,
> DsangWonFan