The Glob template only works on the right side of the comparison, so
if [[ *"My long"* == $string ]]; then echo "It there!"; fi
will fail.
Even this will not work:
[[ *"My long"* == "My long" ]] && echo "It there!"
But this will work:
[[ "My long" == *"My long"* ]] && echo "It there!"
It there!
, :
string='My long string';
if [[ $string == *"My long"* ]]; then echo "It there!"; fi
- glob RHS, *
- "My long", "My long", .