Well, I don't understand the -w option. And I don't understand the pipe command, and I don't understand what the arp cache is too well, but: Why not just ping all these addresses first, then use arp to get their MAC's? If you are on this network, your arp cache will store those mac's, at least for a while. If you are not on this network, run the ping command and use tcpdump -i eth0 -n > save and then dredge the save file. Joel
On Wed, Feb 06, 2002 at 03:26:27AM +0800, 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 > --------------------------- > > The problem: > > Each time through the loop, it continues to ping the previous address as well as the >next address thus repeating the entry in the macadd.txt file. i.e. > > First entry > Heading Heading > 192.168.0.100 <macaddress> > > Second entry > > Heading Heading > 192.168.0.100 <macaddress> > 192.168.0.102 <macaddress> > > Third entry > > Heading Heading > 192.168.0.100 <macaddress> > 192.168.0.102 <macaddress> > 192.168.0.103 <macaddress> > > and so on and so on. > > My question is, does anyone know how to get it to just add the next entry to the >list in the file instead of creating a whole new list each time around and sticking >it in there? > > I've looked many places and tried many things but nothing I've done elimiates this >problem. > > Any advice for me? > > TIA, > > Tom Wilson > -- > > Get your free email from www.linuxmail.org > > > Powered by Outblaze > _______________________________________________ > Linux-users mailing list - http://linux.nf/mailman/listinfo/linux-users > Subscribe/Unsubscribe info, Archives,and Digests are located at the above URL. _______________________________________________ Linux-users mailing list - http://linux.nf/mailman/listinfo/linux-users Subscribe/Unsubscribe info, Archives,and Digests are located at the above URL.