In this case it just searches for port 80 it is fairly handy if you have some sort of appliance or something else you aren't sure of the IP of
Of course change the port 80 port to whatever port(s) you want.
for ip in `arp -n|arp -n|tail -n +2|head -n -1 |grep -v incomplete|awk '{print $1}'`; do
echo "checking $ip:80"
nc -w 1 -z $ip 80
if [ "$?" == 0 ]; then
echo "**Port 80 Open on $ip**"
fi
done
bash, lan, portsin, searches, appliance, aren, ip, arp, grep, incomplete, awk, echo, quot, nc, z, fi,