当前位置:网站首页>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
边栏推荐
- Pyspark operator processing spatial data full parsing (5): how to use spatial operation interface in pyspark
- 全网最全tcpdump和Wireshark抓包实践
- 视频融合云平台EasyCVR增加多级分组,可灵活管理接入设备
- 中移动、蚂蚁、顺丰、兴盛优选技术专家,带你了解架构稳定性保障
- 分布式(一致性协议)之领导人选举( DotNext.Net.Cluster 实现Raft 选举 )
- 2022年大厂Android面试题汇总(一)(含答案)
- FlutterWeb瀏覽器刷新後無法回退的解决方案
- [getting started with MySQL] fourth, explore operators in MySQL with Kiko
- The most complete tcpdump and Wireshark packet capturing practice in the whole network
- 07个人研发的产品及推广-人力资源信息管理系统
猜你喜欢

Interpretation of Flink source code (II): Interpretation of jobgraph source code

Unity tips - draw aiming Center

02 personal developed products and promotion - SMS platform

PyTorch 提取中间层特征?

yarn : 无法加载文件 D:\ProgramFiles\nodejs\yarn.ps1,因为在此系统上禁止运行脚本

Zen integration nails, bugs, needs, etc. are reminded by nails

应用服务配置器(定时,数据库备份,文件备份,异地备份)

C version selenium operation chrome full screen mode display (F11)

当前系统缺少NTFS格式转换器(convert.exe)

Spark calculation operator and some small details in liunx
随机推荐
视频融合云平台EasyCVR增加多级分组,可灵活管理接入设备
Integrated development management platform
Kali2021 installation and basic configuration
The art of Engineering (1): try to package things that do not need to be exposed
06 products and promotion developed by individuals - code statistical tools
Selenium test of automatic answer runs directly in the browser, just like real users.
Concept and basic knowledge of network layering
EasyCVR接入设备开启音频后,视频无法正常播放是什么原因?
[reverse intermediate] eager to try
How to submit data through post
基本磁盘与动态磁盘 RAID磁盘冗余阵列区分
Xin'an Second Edition: Chapter 25 mobile application security requirements analysis and security protection engineering learning notes
mysql高級(索引,視圖,存儲過程,函數,修改密碼)
TCP连接不止用TCP协议沟通
分布式(一致性协议)之领导人选举( DotNext.Net.Cluster 实现Raft 选举 )
学 SQL 必须了解的 10 个高级概念
How to use scroll bars to dynamically adjust parameters in opencv
Binary search strategy
自动化运维利器ansible基础
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