Bash If Substring
string='Hi substring' #To check if string has "Mylong" substring do
if [[ $string == *"substring"* ]]; then
echo "String has substring"
fi
Armandres
string='Hi substring' #To check if string has "Mylong" substring do
if [[ $string == *"substring"* ]]; then
echo "String has substring"
fi
string='Haystack';
if [[ $string =~ "Needle" ]]
then
echo "It's there!"
fi