this code would not work always as ifconfig runs in root login. 

> ----------
> From:         Ashish Srivastava[SMTP:[EMAIL PROTECTED]
> Sent:         Monday, June 23, 2003 9:38 AM
> To:   [EMAIL PROTECTED]
> Cc:   [EMAIL PROTECTED]
> Subject:      Re: How to retrieve a MAC address
> 
>  
>   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-------
>  
> From: [EMAIL PROTECTED]
> Date: Thursday, June 19, 2003 09:50:54 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]
>  
>                       
> ____________________________________________________
> <<File: IMSTP.gif>>   IncrediMail - Email has finally evolved - Click Here
> 
> 
____________________________________________
Confidential:  This electronic message and all contents contain information
from Syntel, Inc. which may be privileged, confidential or otherwise
protected from disclosure. The information is intended to be for the
addressee only. If you are not the addressee, any disclosure, copy,
distribution or use of the contents of this message is prohibited.  If you
have received this electronic message in error, please notify the sender
immediately and destroy the original message and all copies.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to