title: What is the proper method to pipe the output of the cut command into a grep command?
body: <p>I am currently learning a little more about using Bash shell on OSX terminal. I am trying to pipe the output of a cut command into a grep command, but the grep command is not giving any output even though I know there are matches. I am using the following command:</p>
  
  <pre><code>cut -d'|' -f2 &lt;filename.txt&gt; &gt; &lt;temp.txt&gt; | grep -Ff &lt;temp.txt&gt; &lt;searchfile.txt&gt; &gt; &lt;filematches.txt&gt;
  </code></pre>
  
  <p>I was thinking that this should work, but most of the examples I have seen normally pipe <em>grep</em> output into the <em>cut</em>. My goal was to cut field 2 from the  file and use that as the pattern to search for in . However, using the command produced no output.</p>
  
  <p>When I generated the temp.txt first with the <em>cut</em> command and then ran the <em>grep</em> on it manually with no pipe, the <em>grep</em> seemed to run fine. I am not sure why this is?</p>