Hi,
I need help in formatting ouput from system command, i could'nt figure out a
way to format output from system command. appreciate your help with this,
the details are below.
hlis3 is file with list of clients
hosta
hostb
hostc
hostd
The below program looks through each client and outputs the class name,
the desired output needs to be in the below format
-------------------------------------------------------------------------
hosta Solaris_DEV
hostb Solaris_DEV
hostc Archivelogs__DV
Archivelogs__DV
Solaris_DEV
hostd Archivelogs__DV
---------------------------------------------------------------------------
#!/usr/bin/perl
use strict;
use warnings;
open (FILEOUT, ">>cmdout") ||die "cant open cmdout: $! \n";
select (FILEOUT);
open(FILE, "hlis3") || die "Can't open hlis3: $!\n";
while (<FILE>) {
chomp;
print;
my $cmd = `bppllist -byclient $_ \|grep \"CLASS \" |awk \'\{print \$2\}\' `;
printf FILEOUT "%70s\n", $cmd;
}
------------------------------------------------------------------------
program output similar to this. need help in formating this as mentioned in
the begining
hosta Solaris_DEV
hostb Solaris_DEV
hostc Archivelogs__DV
Archivelogs__DV
Solaris_DEV
Regards
Sj
Thread Next