Skip to main content

Linux Bash if string contains another string

str='Sample String'
if [[ "$str" == *Sample* ]]
then
echo "String contains Sample"
fi

Comments

Popular posts from this blog