title: Cut two fields from a for loop string and use each of them to grep two records from a file
body: <p>The file <code>abc.txt</code> is a line sequential file where each record is having multiple fields. I than want to <code>grep</code> two such fields from another line sequential file <code>zzz.txt</code> and display for comparison. </p>
  
  <p>To do so, I am using a <code>for</code> loop i.e. <code>for i in cat abc.txt</code>. I than want to <code>cut</code> two different fields form the emerging string and want to <code>grep</code> these substrings from a file.</p>
  
  <p><strong>Example script</strong></p>
  
  <pre><code>for i in `cat abc.txt`
  do
  field1=`cut -c10-15 $i`
  field2=`cut -c25-30 $i`
  grep $field1 zzz.txt
  grep $field2 zzz.txt
  done
  </code></pre>
  
  <p><strong>Problem</strong></p>
  
  <p>When I try doing it the error message shows the string and says that </p>
  
  <blockquote>
    <p><code>cut: &lt;string in $i&gt;: No such file or directory</code></p>
  </blockquote>
  
  <p>found.</p>