On Fri, 10 May 2002 16:14:34 -0800
civileme <[EMAIL PROTECTED]> wrote:

> [EMAIL PROTECTED] wrote:
> 
> >On Fri, 10 May 2002, Jean-Yves Le Metayer wrote:
> >
> >>Here below is described a bug of this version :
> >>
> >>sample ASCII file (sample.txt)
> >>------------------------------
> >>ab AB
> >>AB ab
> >>cd CD
> >>CD cd
> >>
> >[snip]
> >
> >>simple awk file (simple.awk)
> >>----------------------------
> >>{ line++ }
> >>! /^[A-Z]+/ { print line " -> " $0 }
> >>
> >
> >>command 
> >>-------
> >>
> >>>cat sample.txt | awk -f simple.awk
> >>>
> >>result
> >>------
> >>1 -> ab AB
> >>
> >>Strange result, isn't it? 
> >>The expected result is :
> >>1 -> ab AB
> >>3 -> cd CD
> >>
> >>BUG! At first, I don't believe it. The awk in Mandrake 8.1 cannot be
> >>used.
> >>Is it the same behavior in Mandrake 8.2?
> >>
> >
> >Hmmm.. odd error. I wonder if it's picking up the front anchor as a
> >negation. Your syntax *looks* correct for, but I suspect that awk
> >is interpreting either the bang or the circumflex differently that
> >expected. Try:
> >
> >{ line++ }
> >/^[^[:upper:]]+/ { print line " -> " $0 }
> >
> >What are you specifically trying to match (in English)? 
> >There may be an advantage (as far as execution is concerned) to look
> >for the negation since the check would stop on the first non-match,
> >but it may be a moot point.
> >
> >
> >
> >
> >--------------------------------------------------------------------
> >----
> >
> >Want to buy your Pack or Services from MandrakeSoft? 
> >Go to http://www.mandrakestore.com
> >
> Not strange at all...
> 
> in a terminal window, run locale
> 
> Check the value of LC_COLLATE
> 
> If it is en_US this is quite normal, the collating sequence is AaBbCc,
> etc.
> 
> If you want the result you seek, make your program use upper as 
> suggested or set your LC_COLLATE to POSIX.
> 
> 
> No, it is not a bug, it is a standard expanded feature that keeps 
> programmers on their toes to write platform independent stuff. 
> 
> Civileme

Civilme,


   Where I don't doubt you one bit I did check both my RH7.1 box and my
Mandrake 8.2 box both returned en_US when I did local.  On both I'm on
alt-f1 when I run the test and on 8.2 I got the same as he did with 8.1.
On RH7.1 I got the expected result.  Not saying it's a bug just adding
info to the pool.

James

> 
> 
> 
> 
> 

Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to