[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gawk] Assigning RegExp Variables on the Command Line
From: |
arnold |
Subject: |
Re: [bug-gawk] Assigning RegExp Variables on the Command Line |
Date: |
Tue, 08 Oct 2019 01:28:24 -0600 |
User-agent: |
Heirloom mailx 12.5 7/5/10 |
This looks like a bug; probably a corner case I didn't think
about. The code is simply checking the length of the pattern
and not noticing that the value is of type regexp.
Change the pattern to @/.{1}/ and you'll get 5.
I'll fix this, eventually.
Thanks,
Arnold
Stephane Chazelas <address@hidden> wrote:
> 2019-10-06 21:20:38 +0100, Stephane Chazelas:
> [...]
> > I note that -F @/./ doesn't do the same as -v FS=@/./
> [...]
>
> $ echo ab.c | ./gawk 'BEGIN{FS = @/./}; {print typeof(FS), $1, NF}'
> regexp ab 2
>
> is also confusing. I'd expect to see
>
> regexp 5
>
> if FS is a regexp.
>
> --
> Stephane
>