title: Unix String comparison
body: <p>I have two variables being populated by different means, whose values I want to compare. If you notice the echo below, both variable values are identical, yet the string comparison says "no match". What could be wrong?</p>
  
  <p><strong>Code:</strong>  </p>
  
  <pre><code>IMPALA_NODE=ipaddress.goes.here  
  HIVE_DBNAME="dbname"  
  HIVE_TABLENAME="tablename"  
  CNT_FILE=$(wc -l &lt; /tmp/filename.csv)  
  CNT_EXTTABLE=`impala-shell -k -i $IMPALA_NODE -d $HIVE_DBNAME -q "select count(*)+1 from ${HIVE_TABLENAME};" --quiet -B -c`  
  echo "_${CNT_FILE}_"  
  echo "_${CNT_EXTTABLE}_"  
  if [ "$CNT_EXTTABLE" = "20" ]; then  
  echo "match"  
  else  
  echo "no match"  
  fi  
  </code></pre>
  
  <p><strong>Ouput:</strong><br>
  <code>_20_</code><br>
  <code>_20_</code><br>
  no match</p>