批量测试FTP联通情况并获取当前用户的目录
#!/bin/bash
fpstest()
{
echo "====$1$2开始======">>ftpresults.txt
ftp -i -n $1 <<EOF >>ftpresults.txt
user $2 $3
pwd
EOF
echo "====$1$2结束======">>ftpresults.txt
sleep 1
}
OLD_IFS="$IFS"
IFS=":"
echo "">ftpresults.txt
while read LINE
do
echo $LINE
array=$LINE
ip=${array[0]}
name=${array[1]}
password=${array[2]}
fpstest $ip $name $password
done <ftpip.txt
IFS="$OLD_IFS"
ftpip.txt
127.0.0.1:user:password
127.0.0.1:user1:password1