#!/bin/bash
awk -F '.' '{
if(NF==4){
#print "yes|no"
if (($1>0 && $1<=255) && ($2>=0 && $2<=255) && ($3>=0 && $3<=255) && ($4>=0 && $4<=255)){
print "yes"
}
else{
print "no"
}
}
else{
print "error"
}
}' nowcoder.txt

京公网安备 11010502036488号