Answers for "regular expressions in ifs statements bash"

1

bash regex if condition

Use following structure:
if [[ $digit =~ [0-9] ]]; then //run if a digit included in $digit string
    echo "$digit is a digit"
else
    echo "oops"
fi
Posted by: Guest on November-03-2020

Code answers related to "regular expressions in ifs statements bash"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language