title: bash: using grep in if statement, prevent echo
body: <p>I have this bash script:</p>
  
  <pre><code>#!/bin/bash
  
  external_output="Oliver's AirPort Express"
  
  if ~/.bin/audiodevice | grep "$external_output"
  then
    ~/.bin/audiodevice output "Internal Speakers"
    echo "Internal Speakers"
  else
    ~/.bin/audiodevice output "$external_output"
    echo "Oliver's AirPort Express"
  fi
  </code></pre>
  
  <p>If the <code>grep</code> is matched, then it of course echoes the match. As I am using it in an if statement, I don't want this to echo.</p>
  
  <p>How can I use <code>grep</code> in my <code>if</code> statement without having it announce the result to me when I run the script?</p>