#!/bin/bash
for i in `seq 1 252`
do
ping -c 1 192.168.111.$i >/dev/null
if [ $? -eq 0 ]
then
echo "192.168.111.$i成功"
else
echo "192.168.111.$i失败" >>/root/ab.sh
fi
done
标签:shell,seq,192.168,echo,ab,111,本地,252,局域网
来源: https://www.cnblogs.com/luyuheng/p/11640457.html