Start New Discussion Reply to this Discussion welcome
How can i find the mac address of all computers and which loop i used for
[B]#!/usr/bin/perl
$file ="/etc/sysconfig/network-scripts/ifcfg-eth0";
open (MYFILE, "$file");
$file1 = <MYFILE>;
while ($file1 ne "") {
chomp ($file1);
$file1 = <MYFILE>;
for ($values = 0; $values < 5; $values++) {
if ($file1 =~ /HWADDR/){
@values = split(/=/,$file1);
print $values[1];
}
}
[/B]
pravin pawar
Newbie Poster
1 post since Jan 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
© 2013 DaniWeb® LLC
Page rendered in 0.0393 seconds
using 2.49MB