title: Bash script with basic if/else and count of processes running based on a pattern
body: <p>I'm trying to write a script that counts the number of processes running matching a patern. If it exceeds a hardcoded value then do something...else do something else.</p>
  
  <p>I am finding out the count of processes using:</p>
  
  <pre><code>ps ax | grep process_name | wc -l | sed -e "s: ::g"
  </code></pre>
  
  <p>If the output of the above command is greater than 15..it should echo "Done". Otherwise, echo "Not Complete".</p>
  
  <p>So far, I have this but it isn't working:</p>
  
  <pre><code>numprocesses=ps ax | grep sms_queue | wc -l | sed -e "s: ::g"
  if [ $numprocesses -le "15" ] ; then
    echo "Done."
  else
    echo "Not Complete."
  fi
  </code></pre>