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: David G. Pickett
Subject: bug#69929: Can grep -q report matches in incomplete lines?
Date: Sun, 24 Mar 2024 13:06:13 +0000 (UTC)

 Perhaps the man page should warn users that such last lines are ignored.  Is 
there a mention under an option to include or disclude them?
    On Saturday, March 23, 2024 at 05:08:08 PM EDT, Martin Schulte 
<gnu@schrader-schulte.de> wrote:  
 
 Hello David!

Am Fri, 22 Mar 2024 20:42:12 +0000 (UTC) schrieb "David G. Pickett" via Bug 
reports for GNU grep <bug-grep@gnu.org>:
> Most users consider a line at EOF lacking a trailing newline as still a line, 
> but perhaps some do not?

Well, POSIX doesn't: 
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206

The definition may cause trouble with shell's read - e.g. when reading a file 
created on Windows with notepad where it is easy to accidentally create an 
incomplete line (compared to vi where I don't know an easy way).

Best regards,

Martin
  

reply via email to

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