title: [: : bad number on the bash script
body: <p>This is my bash script:</p>
  
  <pre><code>#!/usr/local/bin/bash -x
  
  touch /usr/local/p
  touch /usr/local/rec
  DATA_FULL=`date +%Y.%m.%d.%H`
  CHECK=`netstat -an | grep ESTAB | egrep '(13001|13002|13003|13004|13061|13099|16001|16002|16003|16004|16061|16099|18001|18002|18003|18004|18061|18099|20001|20002|20003|20004|20061|20099|13000|16000|18000|20000)' | awk '{ print $5 }' | sort -u | wc -l`
  netstat -an | grep ESTAB | egrep '(13001|13002|13003|13004|13061|13099|16001|16002|16003|16004|16061|16099|18001|18002|18003|18004|18061|18099|20001|20002|20003|20004|20061|20099|13000|16000|18000|20000)' | awk '{ print $5 }' | sort -u | wc -l &gt; /usr/local/www/p
  
  STAT=`cat /usr/local/www/rec`
  if [ "$CHECK" -gt "$STAT" ]; then
  echo $CHECK"\n"$DATA_FULL &gt; /usr/local/p
  fi
  </code></pre>
  
  <p>Ofcourse I've runned <code>chmod +x script.sh</code> and then <code>sh script.sh</code>, then I receive the following message: <code>[: : bad number</code>.</p>
  
  <p>Why does it happends?</p>