Is it about how you do recognize last line before script gets to
the end, i.e. '$' is next-to-last read() without EOF?

Yes.  And that "next-to-last" bit is what forces sed to do its lookahead.

In the corner case if the line was read and then
network connection was dropped

... you don't care, but the spec does.

But let's look at this from general POV. `sed` read lines and applies
whole script to the line, i.e. line-by-line. What is done now is not
performing this in reported case. Line isn't processed and printed.

No, the output is indeed produced by running the program on each line of the input, but it's not specified *when* the line is processed.

Then, "ADDR,$" you're right that could be optimized, unlike "$" or "$!". That's a separate feature request.

Paolo



--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to