How to check if a string contains a substring and does not in Bash : <p>I am wanting to use a switch/ case statement in bash to check if a file name which is a string contains something but also does not.</p>

<p>Here is my case:</p>

<pre><code>case "$fileName" in
    *Failed|!cp*)
       echo "match"
     ;;
esac
</code></pre>

<p>But this does not work currently, how can I see if the string matches "Failed" but also does not contain "cp"?</p>

<p>It would be great if this could be done in a switch/ case as well</p>
