[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: feature request: only set RT when RS is found
From: |
arnold |
Subject: |
Re: feature request: only set RT when RS is found |
Date: |
Fri, 17 Sep 2021 01:46:40 -0600 |
User-agent: |
Heirloom mailx 12.5 7/5/10 |
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