Bug#545740: grep -c without needing to then pipe sed '/:0$/d'

View: New views
1 Messages — Rating Filter:   Alert me  

Bug#545740: grep -c without needing to then pipe sed '/:0$/d'

by jidanni :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

X-debbugs-cc: bug-grep@...
Package: grep
Version: 2.5.4-4
Severity: wishlist

Regarding
  -c, --count               print only a count of matching lines per FILE

$ echo zzz>ddd
Why can't there be a way to get rid of
$ grep -c zzz *|wc -l #these 30 extra lines:
31
$ grep -c zzz *|sed '/:0$/d' #<-- without having to resort to this
ddd:1

Wouldn't adding an optional way to specify "don't tell me about files
with no matches" be more in the grep spirit?