Answers for "how to validate a mobile number in shell script"

0

how to validate a mobile number in shell script

echo "Enter a phone number as XXXXXXXX: "
read phoneNumber
pat="^[0-9]{8}$"
while [[ ! $phoneNumber =~ $pat ]]
    do
    echo "Please enter a phone number as XXXXXXXX: "
    read phoneNumber
done
echo $phoneNumber
Posted by: Guest on May-26-2021
0

how to validate a mobile number in shell script

112121212121122221
Posted by: Guest on July-29-2021
0

how to validate a mobile number in shell script

85625566595
Posted by: Guest on May-26-2021
-1

how to validate a mobile number in shell script

#!/bin/bash
echo "Enter a phone number as XXXXXXXX: "
read phoneNumber
pat="^[0-9]{8}$"
while [[ ! $phoneNumber =~ $pat ]]
    do
    echo "Please enter a phone number as XXXXXXXX: "
    read phoneNumber
done
echo $phoneNumber
Posted by: Guest on April-21-2020

Code answers related to "how to validate a mobile number in shell script"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language