#!/usr/bin/perl
## Set pragmas (LC) and modules (UC)
$^W = 1;
use strict;
use strict 'subs';
## Begin Logic
$ENV{"PATH"} = qq(/home/root:/usr/bin:/usr/sbin);
my $w="40";
my $total="0";
my $outfile1 = qq(/home/root/tsm2_clients.out);
my $outfile2 = qq(/home/root/tsm2_clients.plout);
open (FF, "+<$outfile1") || die "could not open file: $outfile1 $!";
open (FFF, "+<$outfile2") || die "could not open file: $outfile2 $!";
system qq(dsmadmc -id=admin -password=st0rm "tsm:select node_name from
nodes > $outfile1"
);
system qq(dsmadmc -id=admin -password=st0rm "tsm:select count(*) node_name
from nodes >> $
outfile1" );
# what happens when more nodes get added?
while (<FF>) {
if ( $. > 6 ) {
if ( $_ !~ "ANR*" or $_ !~ "ANS*" ) {
print FFF $_;
/^s+(\d+) $/ and $total +=$1;
}
}
}
print "Total Nodes on TSM1 and TSM2: $total\n";
close (FF) or warn "error closing $outfile1: $!";
close (FFF) or warn "error closing $outfile2: $!";
I tried the code give by John Krahn as hightlighted and this did not work.
Thanks though... any other ideas?
John Doe
<security.departm
[EMAIL PROTECTED]> To
[email protected]
03/04/2005 11:37 cc
PM
Subject
Re: reg exp
Please respond to
security.departme
[EMAIL PROTECTED]
Hello (again) Derek
Am Samstag, 5. M�rz 2005 05.06 schrieb [EMAIL PROTECTED]:
> I have the file as attached and I want to take 104 and 356 to get a sum.
> Here is my code:
>
>
> while (<FF>) {
> if ( $. > 6 ) {
> if ( $_ !~ "ANR*" or $_ !~ "ANS*" ) {
> print FFF $_;
> }
> }
> next unless $_ /^[a-zA-Z0-9]$/ {
> print $_;
> }
> }
> [...]
I would start with checking the syntax of this code first (using strict and
warnings) to get the syntax right.
Otherwise, you can't test the code :-)
greetings joe
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>