bug-grep
[Top][All Lists]
Advanced

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

bug#69929: Can grep -q report matches in incomplete lines?


From: Paul Eggert
Subject: bug#69929: Can grep -q report matches in incomplete lines?
Date: Thu, 21 Mar 2024 17:51:34 -0700
User-agent: Mozilla Thunderbird

On 3/21/24 06:57, Niels Möller wrote:
I'm having grep -q read input from a pipe. I would like grep to exit
successfully as soon as a match occurs, without requiring the line to be
terminated by newline or EOF (unless the grep pattern includes '$', that
is).

Grep used to behave almost that way. It did wait for a newline but it did not wait for EOF. But people started complaining about that behavior so we changed it.

Perhaps there should be an option to switch between old and new behaviors.

However, not waiting for a newline is problematic; although doable it would be a bit of a pain to program and not sure it's worth the effort. Grep didn't used to do that.





reply via email to

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