Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

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
Comment

PREVIOUS NEXT
Code Example
Shell :: psneuter download 
Shell :: go mod donwload from github 
Shell :: Install docker EE without internet 
Shell :: * Connection #0 to host artifactory-us.cytiva.net left intact 
Shell :: statistical inference project part 1 github 
Shell :: hue run command line arguments 
Shell :: untar 
Shell :: fzf rpm 
Shell :: linux get notification if bettery full 
Shell :: find all file with tilda sign? 
Php :: php check folder exists and create 
Php :: tinker lost colors 
Php :: list all files in directory php 
Php :: env clear cache laravel 
Php :: php uppercase 
Php :: wc get product image 
Php :: check if user is on mobile php 
Php :: pdo last insert id 
Php :: wordpress error log 
Php :: (2482:3) autoprefixer: Replace color-adjust to print-color-adjust. The color-adjust shorthand is currently deprecated. 
Php :: store file into specific directory laravel using storage facade 
Php :: how to connect database in php 
Php :: PHP Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: 
Php :: laravel foreach else 
Php :: woocommerce get my account url 
Php :: php check if object has key 
Php :: number format comma php 
Php :: laravel make directory if not exists 
Php :: php dom add class to element 
Php :: php filter email 
ADD CONTENT
Topic
Content
Source link
Name
9+8 =