title: grep 2 words at if statements in Bash
body: <p>I am trying to see if my nohup file contains the words that I am looking for. If it does, then I need to put that into tmp file.</p>
  
  <p>So I am currently using:</p>
  
  <pre><code>if  grep -q "Started|missing" $DIR3/$dirName/nohup.out
  then
    grep -E "Started|missing" "$DIR3/$dirName/nohup.out" &gt; tmp
  fi
  </code></pre>
  
  <p>But it never goes into the if statement even if there are words that I am looking for.</p>
  
  <p>How can I fix this?</p>