cat ip_list | while read line do $(/usr/bin/nc -v -z $line >>/dev/null)
if [ $? -eq 0 ];then
echo $line >> success.txt
else
echo $line >> fulure.txt
fi
done
shell_端口探测脚本
原文:https://www.cnblogs.com/quemengqio/p/14046852.html