Answers for "how to check whether a string contains a special character or not in bash"

0

how to check whether a string contains a special character or not in bash

if [[ $str =~ ['!@#$%^&*()_+'] ]]; then
    echo yes
else
    echo no
fi
Posted by: Guest on September-05-2020

Code answers related to "how to check whether a string contains a special character or not in bash"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language