bash if string contains or code example
Example: bash if substring
string='Hi substring' #To check if string has "Mylong" substring do
if [[ $string == *"substring"* ]]; then
echo "String has substring"
fi
string='Hi substring' #To check if string has "Mylong" substring do
if [[ $string == *"substring"* ]]; then
echo "String has substring"
fi