title: Redirect grep output to file
body: <p>I am not sure as to why that redirection provided in the code does not work. Every time I run the script, the output file is always empty. Does anyone have an idea on that? </p>
  
  <p>Thanks. </p>
  
  <pre><code>#!/bin/sh
  
  LOOK_FOR="DefaultProblem"
  FILES=`ls plugins/*source*.jar`
  
  for i in $FILES
    do
      # echo "Looking in $i ..."
      unzip -p $i | grep -i $LOOK_FOR &gt; output #&gt; /dev/null 
      if [ $? == 0 ]
      then
        echo "&gt;&gt;&gt;&gt; Found $LOOK_FOR in $i &lt;&lt;&lt;&lt;"
      fi
    done
  </code></pre>