title: How to fetch and display just the count of grep matches against each file that has the matching string?
body: <pre><code>cat Samplescript
  </code></pre>
  <pre><code>for OUTPUT in $(grep -lR &quot;Sample sv15 Processor&quot; ./*) #List files with matching string
  do
      grep &quot;Sample sv15 Processor&quot; $OUTPUT | wc -l
  done
  </code></pre>
  <p>My approach is to list files with matching strings<br />
  Then run a grep search against each file name from the list.<br />
  Finally, use <code>wc -l</code> via pipeline<br />
  <br />
  What am I missing?</p>