Hi Paul,
Here is the additional lines that I added them in after
taking your
suggestion. However, I'm still not able to pass the stdout
to an array
& then read and parse it to get a specific line. Could
you take a
look & help me out?
use strict;
use warnings;
my $CLI_PATH="/bin/clui";
my $hostFile = "test.out";
open (fhHostFile, $hostFile) || die "Cannot open
$hostFile : $!n";
while (<fhHostFile>) {
my $hostInfo=$_;
next unless $. >3; # skip the 1st 3 tab
my host_info=split /|/, $hostInfo;
my output = `$CLI_PATH -cmd retrieve.host -s
file:admin_passwd -ID NM:$host_info[2]`;
open (fhOutputLines, output) || die "Cannot read output :
$!n";
while (<fhOutputLines>) {
my $output = $_;
my $appID = `grep "^[ ]*|[0-9]" output |
awk -F'|' '{print
$2}'`;
my $cmd = sprintf("%s -cmd host.info -s %s
-ID %s",
$CLI_PATH,
"file:admin_passwd",
$appID);
print "Running: $cmdn";
system ($cmd);
}
close (fhOutputLines);
}
Thx much,
-Chris
|