title: Bash shell 'if' statement comparing outputs from different commands
body: <p>Using an adapted <a href="https://stackoverflow.com/questions/7809689/bash-ip-if-then-else-statement/7809853#7809853">example given to me by Sam Ruby</a>  which I have tweaked so I can show what I'm trying to achieve.</p>
  
  <pre><code>app1=$(someapp -flag | grep usefulstuff | cut -c 5-10)
  if [$app1 = (someapptwo -flag | grep usefulstuff | cut -c 20-25)]; then
  mkdir IPFolder-1
  elif ...blah blah
  fi 
  </code></pre>
  
  <p>Can I use grep as show above or am I barking up the wrong tree? or should it look a little some thing like this:</p>
  
  <pre><code>app1=$(someapp -flag | grep usefulstuff | cut -c 5-10)
  app2=$(someapptwo -flag | grep usefulstuff | cut -c 20-25)
  if [$app1 = $app2]; then
  mkdir IPFolder-1
  elif ...blah blah
  fi 
  </code></pre>