title: Multiple "grep...then..." in bash
body: <p>I'm writing a bash script which monitoring the output of script A, and matching keyword by &quot;grep&quot; command. If successfully found the keyword, echo something. Here is the script I have:</p>
  <pre><code>if script_A | grep -q 'keyword'; 
  then
  echo 'Found A!'
  </code></pre>
  <p>The script function well if only one condition. However I cannot find a way to match several keywords, and using &quot;if...elif...else&quot; to control the echo content for different conditions.</p>
  <p>Here is the logic I'm trying to achieve:</p>
  <pre><code>script_A |
  if grep 'keyword_A';
  then echo 'Found A!'
  elif grep 'keyword_B';
  then echo 'Found B!'
  else echo 'Found Nothing!'
  </code></pre>
  <p>Thanks!</p>