当前位置:网站首页>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
边栏推荐
- Flink parsing (IV): recovery mechanism
- Uipath browser performs actions in the new tab
- Flink analysis (II): analysis of backpressure mechanism
- [reverse intermediate] eager to try
- Application service configurator (regular, database backup, file backup, remote backup)
- C # nanoframework lighting and key esp32
- 遠程代碼執行滲透測試——B模塊測試
- Huawei certified cloud computing hica
- 【ASM】字节码操作 ClassWriter 类介绍与使用
- BearPi-HM_ Nano development environment
猜你喜欢
Pyspark operator processing spatial data full parsing (5): how to use spatial operation interface in pyspark
node の SQLite
EasyCVR接入设备开启音频后,视频无法正常播放是什么原因?
Kali2021 installation and basic configuration
Spark accumulator and broadcast variables and beginners of sparksql
FlutterWeb浏览器刷新后无法回退的解决方案
分布式不来点网关都说不过去
【ASM】字节码操作 ClassWriter 类介绍与使用
Flink parsing (IV): recovery mechanism
The problem of "syntax error" when uipath executes insert statement is solved
随机推荐
Wordcloud colormap color set and custom colors
About selenium starting Chrome browser flash back
PyTorch 提取中间层特征?
mysql高级(索引,视图,存储过程,函数,修改密码)
MySQL basic addition, deletion, modification and query of SQL statements
Grafana 9 正式发布,更易用,更酷炫了!
Flink parsing (III): memory management
视频融合云平台EasyCVR增加多级分组,可灵活管理接入设备
基于LNMP部署flask项目
【MySQL入门】第三话 · MySQL中常见的数据类型
MySQL error reporting solution
05个人研发的产品及推广-数据同步工具
03 products and promotion developed by individuals - plan service configurator v3.0
yarn : 无法加载文件 D:\ProgramFiles\nodejs\yarn.ps1,因为在此系统上禁止运行脚本
MySQL stored procedure
node の SQLite
[ciscn 2021 South China]rsa writeup
Summary of study notes for 2022 soft exam information security engineer preparation
EasyCVR平台通过接口编辑通道出现报错“ID不能为空”,是什么原因?
Unity particle special effects series - treasure chest of shining stars