shell: search a string if it contains another string
# Search for a substring in another string using wildcard
string='My long string'
substr='My long'
# Note: the wildcard character (*) is outside the double qoute ("")
if [[ "$string" == *"$substr"* ]]; then
echo "Found substring!"
fi