[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gnu awk 3.1.5
From: |
Andrew J. Schorr |
Subject: |
Re: gnu awk 3.1.5 |
Date: |
Thu, 14 Sep 2006 10:39:44 -0400 |
User-agent: |
Mutt/1.4.2.1i |
On Thu, Sep 14, 2006 at 04:20:08PM +0200, Morten Nygaard Åsnes wrote:
> On Thursday 14 September 2006 15:19, you wrote:
> > gawk 'END {a=""; while(length(a)<10) a= (a "a"); print a} ' /dev/null
>
> No, that does not help. I tried this,
>
> awk 'END {a=""; while(a!="aaaa") {a=a "a"; print a,length(a) }}' /dev/null
>
> and it prints
>
> a 1
> aa 1
> aaa 1
> aaaa 1
>
> So it seems it is a problem with this combination of concatenation and
> length()
>
> even stranger, this seems to work ok, just because of the assignment b=a.
>
> awk 'END {a=""; while(a!="aaaa") {a=a "a"; b=a; print length(a),length(b),a
> }}' /dev/null
>
> 1 1 a
> 2 2 aa
> 3 3 aaa
> 4 4 aaaa
Hmmm, which locale are you using? And is this unpatched gawk 3.1.5?
Does it work OK if you set LANG=C in the environment? If so, you
are running into some locale-related bugs. Check out the discussion
thread with the subject 'locale-dependent assertion failure'.
http://lists.gnu.org/archive/html/bug-gnu-utils/2006-07/msg00047.html
The patch in that post may solve your problem...
Regards,
Andy
wstr.patch
Description: Text document
- gnu awk 3.1.5, Morten Nygaard Åsnes, 2006/09/14
- Message not available
- Message not available
- Re: gnu awk 3.1.5,
Andrew J. Schorr <=