当前位置:网站首页>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
边栏推荐
- [ciscn 2021 South China]rsa writeup
- Summary of Android interview questions of Dachang in 2022 (I) (including answers)
- Concept and basic knowledge of network layering
- Deploy flask project based on LNMP
- MySQL advanced (index, view, stored procedure, function, password modification)
- MySQL basic addition, deletion, modification and query of SQL statements
- Integrated development management platform
- 2021-03-22 "display login screen during recovery" can't be canceled. The appearance of lock screen interface leads to the solution that the remotely connected virtual machine can't work normally
- 03个人研发的产品及推广-计划服务配置器V3.0
- The art of Engineering (1): try to package things that do not need to be exposed
猜你喜欢
![[ASM] introduction and use of bytecode operation classwriter class](/img/0b/87c9851e577df8dcf8198a272b81bd.png)
[ASM] introduction and use of bytecode operation classwriter class

Optimization of middle alignment of loading style of device player in easycvr electronic map

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

EasyCVR授权到期页面无法登录,该如何解决?

Re signal writeup

04个人研发的产品及推广-数据推送工具

RepPoints:可形变卷积的进阶

网络分层概念及基本知识

中移动、蚂蚁、顺丰、兴盛优选技术专家,带你了解架构稳定性保障

C # nanoframework lighting and key esp32
随机推荐
About selenium starting Chrome browser flash back
Grafana 9 正式发布,更易用,更酷炫了!
Deploy flask project based on LNMP
Kali2021 installation and basic configuration
Vscode replaces commas, or specific characters with newlines
Reppoints: advanced order of deformable convolution
OpenCV中如何使用滚动条动态调整参数
Run xv6 system
Debug and run the first xv6 program
06个人研发的产品及推广-代码统计工具
Xin'an Second Edition: Chapter 12 network security audit technology principle and application learning notes
应用服务配置器(定时,数据库备份,文件备份,异地备份)
Debug xv6
How uipath determines that an object is null
05 personal R & D products and promotion - data synchronization tool
Openharmony developer documentation open source project
Basic configuration and use of spark
mysql高級(索引,視圖,存儲過程,函數,修改密碼)
MySQL advanced (index, view, stored procedure, function, password modification)
微信小程序获取手机号