标签:bash bin one complete done 探测 echo let for
#!/bin/bash
#by wwp Obtain hostname
>hostname.txt
ip=`cat ip.list`
for i in $ip
do
Hostname=`ssh -t $i hostname`
echo -e "$i \t $Hostname" >> hostname.txt
done
echo "Get hostname complete"
#打印主机名 ip
标签:bash bin one complete done 探测 echo let for
原文地址:https://www.cnblogs.com/wwp01/p/13830628.html