grep -E command check if password is astleast 8 chars plus 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