title: How to Read a file word by word and use those words to grep in bash shell?
body: <p>I want to read a file word by word and i want to use each word in that text file as an input to grep.
  to read the file word by word i have used the following code</p>
  
  <pre><code>for word in $(&lt;filename)
  do
  echo "$word"
  done
  </code></pre>
  
  <p>now when I replaced </p>
  
  <pre><code>echo "$word"
  </code></pre>
  
  <p>with </p>
  
  <pre><code>grep -i "$word"
  </code></pre>
  
  <p>I'm not getting any output.</p>