标签:amp seq done set The down .sh echo tee
#!/bin/bash
set -xv
ip1=‘172.20.100‘
for ip2 in $(seq 0 254)
do
ip=${ip1}.${ip2}
ping -c 2 -i 1 -w 1 $ip > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo -e "ip:$ip up" | tee -a up.txt
else
echo -e "ip:$ip down" | tee -a down.txt
fi
done
标签:amp seq done set The down .sh echo tee
原文地址:https://www.cnblogs.com/leo001/p/10270510.html