We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,111 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
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]
1
Contributor
0
Replies
1
View
pravin pawar
Newbie Poster
1 post since Jan 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0393 seconds using 2.49MB