#!/bin/bash
#
#********************************************************************
#Author: zhuzikang
#QQ: 985848343
#Date: 2021-08-24
#FileName: check_port.sh
#URL: zhuzikang.cn
#Description: The test script
#Copyright (C): 2021 All rights reserved
#********************************************************************
cat ip.txt|while read line
do
/usr/bin/nc -w 1 -z $line > /dev/null 2>&1
if [ $? -eq 0 ]
then
echo telnet $line ok
sleep 1
else
echo telnet $line fail
fi
done
标签:bin,批量,telnet,echo,Sh,zhuzikang,line,端口号
From: https://www.cnblogs.com/zikang/p/17103933.html