News for hackers. Stuff that matters.
Re:Being Ridiculed for My Open Source Project (2013) by dan-robertson on Monday November 07, 2022 @07:03PM (#33514327)
Fwiw I would first reach for grep -c but that has the wrong semantics here as it counts matching lines. I think rg -c is the same but IIRC it also has a --count-matches flag which does what you want. But I don’t think that invalidates your point; I think I got lucky and happened to know how to do this already. And it may be that your program is faster anyway (or that it adapts well if you have multiple patterns)

There are no comments on this comment yet.