title: Why is my if statement not working (bash - zenity)?
body: <p>I am using an if statement to run a different response for each option selected in a yad GUI <code>zenity fork</code>. </p>
  
  <p>For some reason the if statement works with some options and not with others!? </p>
  
  <p><strong>NOTE :</strong> I'm substituting <code>'^'</code> for <code>'</code> in the example</p>
  
  <pre><code>opt=^yad --list --column="Option"  --column="Description" \
       1 "option 1" \
       2 "option 2
          &lt;i&gt; subtext &lt;/i&gt;" \ 
       | cut -c 1^
  echo $opt
  if [[ $opt == 1 ]]
  then
      echo 1
  elif [[ $opt == 2 ]]
  then
      echo 2
  else 
      echo error
  </code></pre>
  
  <p>option one gives: <code>1 1</code> </p>
  
  <p>option 2 gives: <code>2 error</code>.</p>
  
  <p>The variable is being recorded right as is evident by the <code>echo $opt</code> output. I know it has something to do with the <code>subtext</code>, if I erase it the problem goes away, but as to why I have no idea. </p>
  
  <p>Can anyone help me with a fix, or suggest a workaround? </p>
  
  <p>Thanks for all of your help! This problem is really stumping me. </p>