On Tuesday 11 June 2002 1:39 pm, Sundaram Ramasamy wrote: > Hi, > > I have IP address of the machine, I want to get the MAC address of that > machine thru. my program. > > Is there sample program with accepts the IP address and return's the MAC > address of the machine.
You could try this: ping $IP -c1 >/dev/null 2>&1 grep $IP /proc/net/arp | tr -s ' ' | cut -d' ' -f4 (There's a single space in between each of those pairs of ' ', in case it's not obvious.) Antony.
