Windows2003-3790/sdktools/debuggers/sds/info.pl
2020-09-30 16:53:55 +02:00

37 lines
745 B
Perl

# info.pl - works with output of sds info ...
# ($server, $root) = ($1, $2);
# map({print $_ . "\n"} (@buf, "", @sorted));
# make sure we passed an input file.
# open the file and get the data
my @buf = ();
my ($server, $root);
open(F, $ARGV[0]) or die "You must specify an input file.\n";
@lines = <F>;
close(F);
for (@lines)
{
if (/Client root\: (.*)/) {
$root=$1;
(!defined $server) or die "this sucks";
} elsif (/Server address\: (.*)/) {
$server=$1;
(defined $root) or die "we need root";
push @buf, "$root\=$server";
undef $root;
undef $server;
}
}
@sorted = sort {$b cmp $a} @buf;
map({print $_ . "\n"} (@sorted));
end: