Subject: bug#33574: grep -c question

From: Phillip Feldman <[email-masked]>
Date: Sun, 2 Dec 2018 00:03:11 -0800

`grep -c` reports the number of matching lines--not the total number of
times the pattern appears.

On Sat, Dec 1, 2018 at 11:15 PM Helen Grubner <[email-masked]>
wrote:

> Dear Team
>
>
>
> Can you tell me, why I see this with grep -c on a file with following
> content?
>
>
>
> $ cat file_13.txt
>
> 1
>
> 2
>
> 3
>
> 4
>
> 5
>
> 6
>
> 7
>
> 8
>
> 9
>
> 10
>
> 11
>
> 12
>
> 13
>
>
>
> $ grep -c 1 file_13.txt
>
> 5
>
>
>
> Should it not show 6? When search for value 2, it is correct.
>
>
>
> $ grep -c 3 file_13.txt
>
> 2
>
>
>
>
>
> $ file file_13.txt
>
> file_13.txt: ASCII text
>
>
>
> Thank you
>
> Alexander Grubner
>
>
>
>