文件中IP地址的检测脚本
#!/bin/bash
ip-check()
{
ip=$1
$ip | awk --posix '{ if ( ( $0 ~ /^([0-9]{1,3}\.) {3}[0-9]{1,3}/ ) && ( $1<=255 ) && ( $2<=255 ) && ( $3<=255 ) && ( $4<=255 ) )
{print "this is IP "}
else
{print "this is not ip"}
} '
}
本文共 272 字,大约阅读时间需要 1 分钟。
#!/bin/bash
ip-check()
{
ip=$1
$ip | awk --posix '{ if ( ( $0 ~ /^([0-9]{1,3}\.) {3}[0-9]{1,3}/ ) && ( $1<=255 ) && ( $2<=255 ) && ( $3<=255 ) && ( $4<=255 ) )
{print "this is IP "}
else
{print "this is not ip"}
} '
}
转载于:https://blog.51cto.com/keygen/1122775