bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SV: feature request: only set RT when RS is found


From: Ole Petter R?nningen
Subject: SV: feature request: only set RT when RS is found
Date: Fri, 17 Sep 2021 07:50:02 +0000

Indeed you are correct. It is simply an embarrassing error on my part - I 
*thought* I had verified it with a test program, on closer inspection the 
blunder is all mine. My sincerest apologies.

Ole 

-----Opprinnelig melding-----
Fra: arnold@skeeve.com <arnold@skeeve.com> 
Sendt: fredag 17. september 2021 09:47
Til: ole@synkro.no; bug-gawk@gnu.org
Emne: Re: feature request: only set RT when RS is found

Hi. Thanks for the note.

As Ed pointed out, RT is always set, no matter what the value of RS is.
It is set to empty when no matching record separator is found, again, 
irrespective of the value of RS.

If you have a test program and data that can prove otherwise, please submit 
them here.

Thanks!

Arnold

Ole Petter R?nningen <ole@synkro.no> wrote:

> Hi
>
> I am sure this has been discussed many times, yet my google-fu has 
> failed to come up with some rationale.
> 
> As you know, gawk sets the variable RT to whatever matches RS, if RS 
> is a regex. If EOF is reached mid-line and RS is therefore not 
> matched, the record is terminated but RT is NOT set. This is a good 
> way to detect possible "partial lines", for example when processing 
> through a live log-file.
> 
> My proposal is that this behaviour is extended to include the case 
> when RS is a single character such as '\n'. If RS is not found, it 
> should IMHO not be signalled as found by setting RT.
>
> Thank you,
> Ole



reply via email to

[Prev in Thread] Current Thread [Next in Thread]