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 addr
: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 u
> Kipp, James wrote:
> $ifconfig = '/sbin/ifconfig';
> my @hwaddrs = `$ifconfig` =~ /\b((?:[a-f\d]{2}:){5}[a-f\d]{2})\b/gi;
Thanks! Worked like a charm.
Aaron
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
- Original Message -
From: "John W. Krahn" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 19, 2003 8:42 AM
Subject: Re: How to retrieve a MAC address
> "Beau E. Cox" wrote:
> >
> > Attached is a small perl script (ifinf
"Beau E. Cox" wrote:
>
> Attached is a small perl script (ifinfo) I wrote to parse
> ifconfig. It gives most of the information from ifconfig,
> including MAC. It works on rh9.
I tried it out out and found a couple of problems. Your GetOptions
statement has:
'w|mac' => \$opt[2],
gex
> -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?
>
> > -Origi
- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 19, 2003 6:24 AM
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
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 if
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 retrie
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?
Tha
10 matches
Mail list logo