title: bash script for searching from a list of files in directory
body: <p>There are around 20 files in a directory . Each file has the string <code>$str</code> inside it.</p>
  
  <p>I want to write a script that picks out that row containing the string <code>$str</code> and dump into a file .</p>
  
  <p>Each file should dump the searched row into a different file . </p>
  
  <p>For example file1 dumps searched row to file called found1 and file2 dumps it to file called found2 etc.... </p>
  
  <p>Can anyone please guide me regarding this ?</p>
  
  <p>I'm particularly finding it difficult to include the file name in the grep command.</p>
  
  <p>I can't go on to include 20 grep commands.</p>