contains variable bash code example
Example: check if variable contains string bash
STRING='Hello world'
if [[ $STRING =~ "Hello" ]] ; then echo "It's here" ; fi
STRING='Hello world'
if [[ $STRING =~ "Hello" ]] ; then echo "It's here" ; fi