Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • grep ... | wc -l might be simplified to just grep -c ... Commented Dec 15, 2016 at 20:25
  • For starters, why grep | wc -l when you could grep -c? Also, I would throw in some debug output that shows the contents of $command, $comm, and $filename. Commented Dec 15, 2016 at 20:25
  • There are a set of files on which i am applying this grep. I just need the final total count Commented Dec 15, 2016 at 20:33
  • I have updated the variables in the question Commented Dec 15, 2016 at 20:38