title: $str == *"somestring"* vs the use of regex
body: <p>I currenlty have the below bash script working. However, I am unsure if this approach is completely a good one. I am trying to look for substring <code>test</code> in the below directory paths. What would be the best appraoch? regex? Looking for some guidance using the below example</p>
  <pre><code>for str in &quot;/directory/manifest&quot; &quot;directory/test/configs&quot; &quot;directory/test/secrets&quot; &quot;directory/main&quot; &quot;directory/bin&quot;; do
      if [[ $str == *&quot;test&quot;* ]];then
          echo $str
      fi
  done
  </code></pre>