monk2b has asked for the wisdom of the Perl Monks concerning the following question:
Thanks monk2b learning slowly#!/usr/local/bin/perl -w use strict $file2 = "/tmp/boxinfo"; open(FILE2, ">$file2"); $file = "/export/monk2b/doc/testboxes"; open(FILE, "$file"); while(<FILE>) { my($line) = $_; chomp($line); $var1 = `rsh $line cat /proc/cpuinfo | grep "cpu MHz"` ; @par1 = split(/\s+/, $var1); $var2 = `rsh $line free | grep Mem` ; @par2 = split(/\s+/, $var2); $var3 = `rsh $line cat /etc/issue | grep Kernel` ; @par3 = split(/\s+/, $var3); print FILE2 "$line\t$par1[3]\t$par2[1]\t$par3[1]\n"; } close(FILE) close(FILE2)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Not pure perl
by btrott (Parson) on Apr 30, 2001 at 22:23 UTC | |
|
Re: Not pure perl
by DrZaius (Monk) on Apr 30, 2001 at 22:14 UTC | |
|
Re: Not pure perl
by BigRed (Acolyte) on Apr 30, 2001 at 21:53 UTC | |
|
Re: Not pure perl
by isotope (Deacon) on Apr 30, 2001 at 21:51 UTC |