Vérifier si une sous-chaîne existe dans une basse de cordes
string='Haystack';
if [[ $string =~ "Needle" ]]
then
echo "It's there!"
fi
Clumsy Coyote
string='Haystack';
if [[ $string =~ "Needle" ]]
then
echo "It's there!"
fi