I am trying to compare strings in bash. I already found an answer on how to do it on stackoverflow. In script I am trying, I am using the code submitted by Adam in the mentioned question:
if [[ "$string" == *My* ]]
echo "It's there!";
if [[ "$string" == *"$needle"* ]]; then
echo "haystack '$string' contains needle '$needle'"
if [[ $var =~ regexp ]]; then
[[: not found
[[ is a bash-builtin. Your
/bin/bash doesn't seem to be an actual bash.