title: How can I compare the output of a command, (the output is a number) to a number? Trying to see if the output is greater than or equal to 1
body: <p>I'm trying to run a script that essentially runs <code>psg defunct | wc -l</code> and gives output depending on if the output of that is greater than or equal to 1 or not.</p>
  
  <p>However, I can't get the <code>-ge</code> flag to work to do so. I was wondering if anyone has any input as to what I'm doing wrong, and if you could help me correct it. </p>
  
  <p>Here's the current script:</p>
  
  <pre><code> #!/bin/bash -x
   export LANG="C"
   #
   # Created by Blake Smreker | b0s00dg
   # Purpose is to assist users with defunct process tickets
   #
   #
  
   menu ()
   {
   echo "What is the server name?"
   read srvrname
   badboi=$"$srvrname"
   }
  
   vars ()
   {
   psgwc=$"/u/bin/psg defunct | wc -l"
   psgd=$"/u/bin/psg defunct"
   die=$"/bin/kill -9 `psg defunct | awk '{print $3}'`"
   belowmsg=$'echo The number of defunct processes is below threshold! Resolve the ticket and put the following in the ticket:'
   abovemsg=$'echo There is more than 100 zombies! Getting you more information:'
   }
  
   connect ()
   {
   connectme="/usr/bin/dzdo -u oseho /bin/ssh -qo PreferredAuthentications=publickey root@$badboi"
   }
  
   main ()
        {
   ${connectme} ". /u/data/environment; $psgwc"
  
   if ${connectme} $psgwc -ge 1
   then
       $abovemsg
       echo "Determine the owner of the below process. Then copy and paste the below, and send it to the team on Service Now."
       echo "psg defunct | wc -l:"
       ${connectme} $psgwc
       ${connectme} $psgd
   else
       $belowmsg
       echo "psg defunct | wc -l:"
       ${connectme} $psgwc
   fi
   }
  
   menu
   vars
   connect
   main
  </code></pre>
  
  <p>And here is the error message:</p>
  
  <pre><code>+ /usr/bin/dzdo -u oseho /bin/ssh -qo PreferredAuthentications=publickey root@oses4101 /u/bin/psg defunct '|' wc -l -ge 1
  wc: illegal option -- g
  usage: wc [-c | -m | -C] [-lw] [file ...]
  </code></pre>
  
  <p>It seems to think that me putting <code>-ge</code> is apart of me using <code>wc</code>. However, when I try to correct it, it doesn't work. </p>
  
  <p>The issue lies in the if statement towards the bottom.</p>