#!/bin/bash
for i in `seq 1 254`
do
ping -c 1 192.168.238.$i > /dev/null
if [ $? -eq 0 ]
then
echo "192.168.238.$i存活"
else
echo "192.168.238.$i不存活" >> /root/a.txt
fi
done
原文地址:https://www.cnblogs.com/sjzz/p/11597860.html
时间: 2024-10-16 09:57:10