GNU bug report logs - #27931
grep -o fails to count empty lines (Debain Bug #532541)

Previous Next

Package: grep;

Reported by: "Santiago R.R." <santiagorr <at> riseup.net>

Date: Thu, 3 Aug 2017 13:29:02 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: "Santiago R.R." <santiagorr <at> riseup.net>
To: 27931 <at> debbugs.gnu.org
Cc: 532541 <at> bugs.debian.org
Subject: bug#27931: grep -o fails to count empty lines (Debain Bug #532541)
Date: Thu, 3 Aug 2017 15:28:14 +0200
(Sorry if it's already filed, but I am unable to find it in the
bug archives)

Hi,

I'd like to forward this bug reported to Debian some years ago.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=532541
It still happens in 3.1.

Quoting the original report:

When grepping for empty lines in a text file, grep works correctly in
most cases:

~$ grep ^$ myfile.txt 





~$ grep -n ^$ myfile.txt 
11:
15:
19:
21:
22:

However the -o option, which is supposed to return only the matching
parts of the search, fails:

~$ grep -o ^$ myfile.txt 
~$ grep -no ^$ myfile.txt
~$ 


Thanks,

Santiago




This bug report was last modified 7 years and 350 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.