shell脚本的多线程
#!/bin/bash
###这是个多线程脚本!!!!
for i in {..}
do
{
ping -c 192.168..$i >/dev/null
if [ $? = ];then
echo "192.168.2.$i 存活"
else
echo "192.168.2.$i 不存活"
fi
} &
done
wait
2024-02-15 22:06:34
shell脚本的多线程
#!/bin/bash
###这是个多线程脚本!!!!
for i in {..}
do
{
ping -c 192.168..$i >/dev/null
if [ $? = ];then
echo "192.168.2.$i 存活"
else
echo "192.168.2.$i 不存活"
fi
} &
done
wait