grep -c -o does not print count of occurrences

Bug #277528 reported by era
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grep
Unknown
Unknown
grep (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: coreutils

vnix$ grep -c -o fnord <<HERE
> fnord fnord fnord
> HERE
1

One could expect the result to be three, with -o and -c, not one. Some non-GNU greps allegedly work that way. As it is, the combination of -c -o is rather useless.

If it cannot be fixed, then perhaps a warning about the uselessness of this combination of options should be printed.

vnix$ lsb_release -rd
Description: Ubuntu 8.04.1
Release: 8.04

vnix$ dpkg -l coreutils | tail -1
ii coreutils 6.10-3ubuntu2 The GNU core utilities

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

thanks for your report. assigning to grep.

can you please provide the output of the command "apt-cache policy grep"

Thanks in advance.

Revision history for this message
Marcel Stimberg (marcelstimberg) wrote :

The issue still persists in grep 2.6.3-3ubuntu1 (Ubuntu 11.04).

It has already been reported upstream: http://savannah.gnu.org/bugs/?33080

Changed in grep (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.