Hi Fazil,
here a few line to extract the ressource(s) you want!
#!c:\Perl\bin\perl -w
if ($ARGV[0] eq "")
{
print "\n\n";
print "Enter arguments !!\n\n";
print "Example:\n\n\ ";
print "name:, server:, comment:, Save operations:, archive services:,
schedule:, browse
policy:,\n";
print "retention policy:, directive:, group:, save set:, remote access:,
remote user:,
password:,\n";
print "backup command:, application information:, ndmp:, aliases:,archive
users:, storage
nodes:,\n";
print "clone storage nodes:, client OS type:, CPUs:, NetWorker version:,
enabler in use:,\n";
print "licensed applications:, licensed PSPs:\n\n";
print "composed word with space between double quote\n\n";
exit;
}
$a=@ARGV;
$ofile = ">c:\\Perl\\test\\texte\\nsrcliarg.txt"; #path of the output
open (OUTFILE, $ofile) or die "fichier out erreur\n";
open (MM, "c:\\nsr\\bin\\nsradmin -i client.txt -s vdn-nsr1 | ") or
die "cannot get mminfo
report\n";
@listinfo = <MM>;
$i=0; #initialisation du
compteur i$
print OUTFILE "Les Arguments demandes sont les suivants :\n ";
print OUTFILE "@ARGV\n\n";
$n=1;
$b=0;
foreach (@listinfo) { #boucle sur
@listinfo
$y=0;
$listinfo[$i]=~ s/^ +/\t/; #suppression des
espaces debut
foreach (@ARGV) {
if ($listinfo[$i] =~ m /$ARGV[$y]/) {
if ($b==0) {
print OUTFILE "Client : \n" ;
}
print OUTFILE " $listinfo[$i]";
$b=$b+1;
if ($b==$a) {
$b=0;
$n=$n+1;
}
}
$y=$y+1;
next;
}
$i=$i+1;
next;
}
in the file client.txt, there is only 1 line with:
print type: NSR client
Gruss
Marcel
To sign off this list, send email to listserv AT listserv.temple DOT edu and
type "signoff networker" in the body of the email. Please write to
networker-request AT listserv.temple DOT edu if you have any problems with this
list. You can access the archives at
http://listserv.temple.edu/archives/networker.html or
via RSS at http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER
|