On Fri, 10 May 2002 17:43:40 -0400 (EDT)
[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.
>
> >
Ran this one myself on 8.2 and 7.1 redhat. on rh I got the expected
results on 8.2 I got the results you described for 8.1
James
>
>
>
Want to buy your Pack or Services from MandrakeSoft?
Go to http://www.mandrakestore.com