help-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: arnold
Subject: Re: inconstancy with RS = "(\r?\n){2}"
Date: Sun, 25 Jul 2021 03:47:22 -0600
User-agent: Heirloom mailx 12.5 7/5/10

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]