title: How to grep a pattern from a file
body: <p>i want to read a file and grep pattern inside and display it line by line.</p>
  
  <pre><code>hi
  hi
  hello
  hey
  hello
  hi
  </code></pre>
  
  <p>These are my file contents.</p>
  
  <pre><code>files="testOne.sh demo.sh test.sh"
  
  for i in $files
  do
      while read line
      do
              pat=`grep "hi"`
              echo $pat
      done &lt; $i
  done
  </code></pre>
  
  <p>And this is my code .</p>
  
  <p>Can anyone help me out with this</p>