how to check whether character is certain characters in shell script code example
Example: how to check whether a string contains a special character or not in bash
if [[ $str =~ ['!@#$%^&*()_+'] ]]; then
echo yes
else
echo no
fi
if [[ $str =~ ['!@#$%^&*()_+'] ]]; then
echo yes
else
echo no
fi