bug-gawk
[Top][All Lists]
Advanced

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

Re: inconstancy with RS = "(\r?\n){2}"


From: Alex fxmbsw7 Ratchev
Subject: Re: inconstancy with RS = "(\r?\n){2}"
Date: Sun, 25 Jul 2021 12:05:21 +0200

hi, i see, complicated readahead, or something, but its buggy

my example goes exactly like yours ( gawk .. ) but, no file, terminal ( or
tcp socket input )
.. you can run your gawk again but with no file but terminal input ( cause
i dont have else, tcp connection that doesnt end is my case, http client to
httpd connecrion )
so start that gawk again, and just press enter a couple of times, .. its
supposed to print a newline after two enters, .. it doesnt.. so it also
doesnt stop on the http tcp conn

sorry, thanks

On Sun, Jul 25, 2021, 11:47 <arnold@skeeve.com> wrote:

> Greetings.
>
> Thank you for taking the time to make a bug report. In the future please
> send a concise description of the problem with a test program and data.
> It was hard for me to determine what you really think is the bug.
>
> It looks like your concern is with the need to enter EOF more than
> once from the terminal.
>
> Gawk is designed mainly for batch processing (from files or a pipe).
> Reading from a terminal with a complicated regexp as RS isn't the
> normal use case.  When RS is a regexp gawk may have to do lookahead in
> the input stream to be sure that the regexp has matched, and thus
> the need for multiple EOFs.
>
> In any case, I don't think there is an actual bug:
>
> $ od -c data
> 0000000   a  \n  \n  \n   b  \n  \n  \n  \n   c  \n  \n  \n  \n   d  \n
> 0000020
> $ ./gawk -v RS='(\r?\n){2}' -v ORS='|\n' '{ print }' < data
> a|
>
> b|
> |
> c|
> |
> d
> |
>
> This looks right to me.
>
> Thanks,
>
> Arnold
>


reply via email to

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