#!/bin/bash
 
netid="128.5.0."
n=0
for i in $(seq 1 254)
do
    ping -c1 -W1 -n $netid$i &> /dev/null
    if [ $? == 0 ]
    then
        echo -e "$netid$i is UP!"
        let n+=1
    fi
done
echo -e "====================\nTotle: $n\n"
09-30 20:52