ping a range of ips
well if i need to ping a range of ips I can use a small script like this#!/bin/bash
for i in { 1..50}
doping -c2 192.168.0.$i &> /dev/null
if [ $?=0 ]; then
echo "UP"
else
echo "DOWN"
fi
done
But I need to do this via a C program . How can I achieve the same ?
|