Tom Wilson wrote:
> 
> Hi all,
> 
> First, my script abilility rests in /dev/null.  That being said, what I am *trying* 
>to do is get a text file with a list of MAC addresses and the corresponding IP's for 
>certain ranges of IP's.
> 
> Part of my solution:
> ---------------------------
> for i in `seq 100 120`; do
>      ping -c 5 -w 5 192.168.0.$1 | arp >> macadd.txt
> done
> ---------------------------
<SNIP>
> 
> I've looked many places and tried many things but nothing I've done elimiates this 
>problem.
> 
> Any advice for me?

How bout this:

I don't have many hosts on my net, and the subnet is different, change
to suit, but it works here.

-----------------------
for i in `seq 1 10`; do
     ping -c 5 -w 1 192.168.1.$i | arp -n | grep 192.168.1.$i >>
macadd.txt
done

sort -u macadd.txt > macadd2.txt
mv macadd2.txt macadd.txt
-----------------------
-- 
Linux SxS [http://sxs.webhop.net/]
_______________________________________________
Linux-users mailing list - http://linux.nf/mailman/listinfo/linux-users
Subscribe/Unsubscribe info, Archives,and Digests are located at the above URL.

Reply via email to