954,525 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

welcome

How can i find the mac address of all computers and which loop i used for

<strong>#!/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];

         }
     }
</strong>
pravin pawar
Newbie Poster
1 post since Jan 2012
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You