i don't have access to a linux box at the moment (Solaris's ifconfig is different) but I did find this in some older emails: $ifconfig = '/sbin/ifconfig'; my @hwaddrs = `$ifconfig` =~ /\b((?:[a-f\d]{2}:){5}[a-f\d]{2})\b/gi;
you can do the rest :) and I did not test the regex > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Thursday, June 19, 2003 12:49 PM > To: [EMAIL PROTECTED] > Subject: RE: How to retrieve a MAC address > > > Do you have any examples of this in action? > > > -----Original Message----- > > From: Kipp, James [mailto:[EMAIL PROTECTED] > > Sent: Thursday, June 19, 2003 11:26 AM > > To: Aaron Gillette; [EMAIL PROTECTED] > > Subject: RE: How to retrieve a MAC address > > > > > > you can parse ifconfig or arp and get it > > > > > -----Original Message----- > > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > > Sent: Thursday, June 19, 2003 12:24 PM > > > To: [EMAIL PROTECTED] > > > 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 > > > > > > -- > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]