how to check whether given input is certain character 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