title: Bash compare a command output to string
body: <p>Output is same, and it always echos <code>need to pull</code>.
  If I remove the quotes around <code>$text</code> in <code>if</code> condition it throws the <code>too many arguments</code> error. </p>
  
  <pre><code>var="$(git status -uno)" &amp;&amp; 
  
  text="On branch master Your branch is up-to-date with 'origin/master'. nothing to commit (use -u to show untracked files)"; 
  
  echo  $var; 
  echo  $text; 
  if [ "$var" = "$text" ]; then
      echo "Up-to-date"
  else
      echo "need to pull"
  fi
  
  </code></pre>