当前位置:网站首页>Shell input a string of numbers to determine whether it is a mobile phone number
Shell input a string of numbers to determine whether it is a mobile phone number
2022-07-06 17:44:00 【Oh, no, I forgot my paper】
[[email protected] ~]# cat phone.sh
#!/bin/bash
echo " Enter a string of numbers to determine whether it is a mobile phone number "
read -ep "" num
if [[ "$num" =~ ^[1][3|5|8|9][0-9]{
9}$ ]];then
echo " It's a cell phone number "
else
echo " Not a cell phone number "
fi
[[email protected] ~]# ./phone.sh
Enter a string of numbers to determine whether it is a mobile phone number
135
Not a cell phone number
[[email protected] ~]# ./phone.sh
Enter a string of numbers to determine whether it is a mobile phone number
13567877777
It's a cell phone number
[[email protected] ~]# ./phone.sh
Enter a string of numbers to determine whether it is a mobile phone number
135555553566
Not a cell phone number
[[email protected] ~]# ./phone.sh
Enter a string of numbers to determine whether it is a mobile phone number
13131314dsv13z.
Not a cell phone number
边栏推荐
- 07 personal R & D products and promotion - human resources information management system
- About selenium starting Chrome browser flash back
- sql语句优化,order by desc速度优化
- Total / statistics function of MySQL
- 2022年大厂Android面试题汇总(一)(含答案)
- [rapid environment construction] openharmony 10 minute tutorial (cub pie)
- Establishment of graphical monitoring grafana
- 微信小程序获取手机号
- connection reset by peer
- Automatic operation and maintenance sharp weapon ansible Foundation
猜你喜欢

06 products and promotion developed by individuals - code statistical tools

Deploy flask project based on LNMP

Summary of Android interview questions of Dachang in 2022 (I) (including answers)

pip install pyodbc : ERROR: Command errored out with exit status 1

Flink analysis (I): basic concept analysis

Application service configurator (regular, database backup, file backup, remote backup)

2022年大厂Android面试题汇总(二)(含答案)

EasyCVR接入设备开启音频后,视频无法正常播放是什么原因?

【MySQL入门】第四话 · 和kiko一起探索MySQL中的运算符

自动化运维利器ansible基础
随机推荐
【ASM】字节码操作 ClassWriter 类介绍与使用
Openharmony developer documentation open source project
Start job: operation returned an invalid status code 'badrequst' or 'forbidden‘
Guidelines for preparing for the 2022 soft exam information security engineer exam
Reppoints: advanced order of deformable convolution
mysql高级(索引,视图,存储过程,函数,修改密码)
Remote code execution penetration test - B module test
How uipath determines that an object is null
[introduction to MySQL] the first sentence · first time in the "database" Mainland
[reverse] repair IAT and close ASLR after shelling
05 personal R & D products and promotion - data synchronization tool
Flink analysis (II): analysis of backpressure mechanism
MySQL报错解决
PySpark算子处理空间数据全解析(4): 先说说空间运算
C version selenium operation chrome full screen mode display (F11)
EasyCVR接入设备开启音频后,视频无法正常播放是什么原因?
Grafana 9 is officially released, which is easier to use and more cool!
【MySQL入门】第三话 · MySQL中常见的数据类型
Automatic operation and maintenance sharp weapon ansible Foundation
Vscode matches and replaces the brackets