title: Linux Shell Script - String Comparison with wildcards
body: <p>I am trying to see if a string is part of another string in shell script (#!bin/sh).</p>
  
  <p>The code i have now is: </p>
  
  <pre><code>#!/bin/sh
  #Test scriptje to test string comparison!
  
  testFoo () {
          t1=$1
          t2=$2
          echo "t1: $t1 t2: $t2"
          if [ $t1 == "*$t2*" ]; then
                  echo "$t1 and $t2 are equal"
          fi
  }
  
  testFoo "bla1" "bla"
  </code></pre>
  
  <p>The result I'm looking for, is that I want to know when "bla" exists in "bla1". </p>
  
  <p>Thanks and kind regards,</p>
  
  <p>UPDATE:
  I've tried both the "contains" function as described here: <a href="https://stackoverflow.com/questions/2829613/how-do-you-tell-if-a-string-contains-another-string-in-unix-shell-scripting">How do you tell if a string contains another string in Unix shell scripting?</a></p>
  
  <p>As well as the syntax in <a href="https://stackoverflow.com/questions/229551/string-contains-in-bash">String contains in bash</a></p>
  
  <p>However, they seem to be non compatible with normal shell script (bin/sh)... </p>
  
  <p>Help?</p>