string='My long string'
if [[ $string == *"My long"* ]]; then
echo "It's there!"
fi
from: https://stackoverflow.com/questions/229551/how-to-check-if-a-string-contains-a-substring-in-bash
In case if you want to check whether file does not contain a specific string, you can do it as follows. if ! grep -q SomeString "$File...
No comments:
Post a Comment