centos 7 里如何判断IP是否合法
ip=123.23.2.32; [[ $ip =~ ^(([1-9]?[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$ ]] && echo legal ip || echo no leagl ip
-------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------- 博客均为个人笔记,无所追求,仅供参考~~~ QQ--2382990774