in reply to Re: MAC address for Linux Machine
in thread MAC address for Linux Machine
sub unique { keys %{{ map { $_, 1 } @_ }} } my $ifconfig; -x and $ifconfig = $_ , last for qw(/sbin/ifconfig /bin/ifconfig); die "Can't find ifconfig\n" unless $ifconfig; my @hwaddrs = `$ifconfig` =~ /\b((?:[a-f\d]{2}:){5}[a-f\d]{2})\b/gi; { local ($\, $,) = ("\n", "\n") and print unique @hwaddrs }
iam this code to get MAC address ,but my application is if i give IP i want to get MAC address of remote IP
20040403 Edit by Corion: Added formatting
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: MAC address for Linux Machine
by nimdokk (Vicar) on Apr 03, 2004 at 22:11 UTC |