GNU bug report logs - #42245
grep -l -c does not work like expected

Previous Next

Package: grep;

Reported by: muellae <at> online.de

Date: Tue, 7 Jul 2020 14:46:02 UTC

Severity: wishlist

To reply to this bug, email your comments to 42245 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-grep <at> gnu.org:
bug#42245; Package grep. (Tue, 07 Jul 2020 14:46:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to muellae <at> online.de:
New bug report received and forwarded. Copy sent to bug-grep <at> gnu.org. (Tue, 07 Jul 2020 14:46:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Volker Raab <muell_collect <at> raaab.de>
To: bug-grep <at> gnu.org
Subject: grep -l -c does not work like expected
Date: Tue, 7 Jul 2020 14:48:53 +0200
[Message part 1 (text/plain, inline)]
Hi all,


are the options "-l" and "-c" mutually incompatible?
And if so, why?

What happens:
When I enter 'grep -c search *' I get _all_ files listed with the number
of matches (many of them with appended ":0" ).
When I enter 'grep -c search *' I get a list of files which match.

But:
When I enter 'grep -l -c search *' I still get the same result as
without '-c'. (the same happens if I exchange '-l' and '-c')

What I expect:
In the latter case I would expect to get a list of all files that match
with an appended ":xxx'  where the xxx denotes the number of matches,
none of which is ":0"

Comment:
Yes, of course I can pipe the result through 'grep -v :0' but this is
clumsy and does not mend that the combination of '-l' and '-c' does not
produce the expected result.

Thanks a lot for considering this in future versions.


Best regards
		Volker



[pEpkey.asc (application/pgp-keys, attachment)]

Severity set to 'wishlist' from 'normal' Request was from Paul Eggert <eggert <at> cs.ucla.edu> to control <at> debbugs.gnu.org. (Mon, 21 Sep 2020 19:48:01 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 267 days ago.

Previous Next


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