Try following code on 'Linux'
#!/usr/bin/perl -w use strict; my @lines = `ifconfig`; my $fline = shift @lines; chomp $fline; $fline =~ /HWaddr\s+(.*)$/; print "$1\n";
cheers
Ashish
-------Original Message-------
Date: Thursday, June 19, 2003 09:50:54 PM
Subject: How to retrieve a MAC address
Hi All,
I need to retrieve the MAC address of my local system from a Perl script.
I'm running RedHat 7.2.
Can anyone point me to some sample code for accomplishing this? I've Googled
for quite a while, and come up empty.
Alternatively, does anyone know where the MAC is stored on RedHat 7.2?
Thanks,
Aaron
--
|