title: check if variable contains the output of a string for multiple values in shell script
body: <pre><code>output=`sql -c "show sca_mode"` # ----&gt; [ NOTICE:  SCA_MODE is off
                                  #                         SHOW VARIABLE] 
  </code></pre>
  
  <p>it might show <strong>on or off</strong> as per variable set.</p>
  
  <p>i want to display if sca_mode=true then copy abc.exp_scamode_true file  and if SCA_MODE is off then abc.exp_scamode_file</p>
  
  <p>if i am executing below command :</p>
  
  <pre><code>[bin]$ if [[ "$output" = *on* ]]; then sca_mode=true ;else sca_mode=false; fi
  [bin]$ echo $output
   SHOW VARIABLE
  </code></pre>
  
  <p>i am not getting "on" or "off" value rather its showing the last row</p>