bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#33574: grep -c question


From: Paul Jackson
Subject: bug#33574: grep -c question
Date: Sun, 02 Dec 2018 08:55:49 -0600

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

Yes. 

In other words, the line "11" counts as 1 match (one line), not as two matches.

I  would expect the command "grep -c somepattern somefile" to provide the
same results as the command "grep somepattern somefile | wc -l" (each matching
line counts once.)

-- 
                Paul Jackson
                address@hidden





reply via email to

[Prev in Thread] Current Thread [Next in Thread]