当前位置:网站首页>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
边栏推荐
- 【Elastic】Elastic缺少xpack无法创建模板 unknown setting index.lifecycle.name index.lifecycle.rollover_alias
- MySQL basic addition, deletion, modification and query of SQL statements
- Start job: operation returned an invalid status code 'badrequst' or 'forbidden‘
- 06个人研发的产品及推广-代码统计工具
- Basic configuration and use of spark
- Kali2021 installation and basic configuration
- VR全景婚礼,帮助新人记录浪漫且美好的场景
- Interpretation of Flink source code (II): Interpretation of jobgraph source code
- TCP connection is more than communicating with TCP protocol
- PySpark算子处理空间数据全解析(4): 先说说空间运算
猜你喜欢
EasyCVR电子地图中设备播放器loading样式的居中对齐优化
FlutterWeb浏览器刷新后无法回退的解决方案
Application service configurator (regular, database backup, file backup, remote backup)
Unity particle special effects series - treasure chest of shining stars
Start job: operation returned an invalid status code 'badrequst' or 'forbidden‘
How to use scroll bars to dynamically adjust parameters in opencv
[reverse primary] Unique
The NTFS format converter (convert.exe) is missing from the current system
自动化运维利器ansible基础
BearPi-HM_ Nano development board "flower protector" case
随机推荐
[ASM] introduction and use of bytecode operation classwriter class
[reverse intermediate] eager to try
【MySQL入门】第三话 · MySQL中常见的数据类型
中移动、蚂蚁、顺丰、兴盛优选技术专家,带你了解架构稳定性保障
Development and practice of lightweight planning service tools
C#WinForm中的dataGridView滚动条定位
Xin'an Second Edition: Chapter 24 industrial control safety demand analysis and safety protection engineering learning notes
How to use scroll bars to dynamically adjust parameters in opencv
C WinForm series button easy to use
Flink parsing (VII): time window
Flink parsing (IV): recovery mechanism
FlutterWeb瀏覽器刷新後無法回退的解决方案
02 personal developed products and promotion - SMS platform
EasyCVR电子地图中设备播放器loading样式的居中对齐优化
灵活报表v1.0(简单版)
在一台服务器上部署多个EasyCVR出现报错“Press any to exit”,如何解决?
04 products and promotion developed by individuals - data push tool
MySQL Advanced (index, view, stored procedures, functions, Change password)
Zen integration nails, bugs, needs, etc. are reminded by nails
[mmdetection] solves the installation problem