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.
Here is my case:
case "$fileName" in
*Failed|!cp*)
echo "match"
;;
esac
But this does not work currently, how can I see if the string matches "Failed" but also does not contain "cp"?
It would be great if this could be done in a switch/ case as well