0
|
1 use strict;
|
|
2 use warnings;
|
|
3
|
|
4 my @progs = split "\n", `wossname -showembassy GEMBASSY -auto | cut -d ' ' -f 1| grep ^g | sort`;
|
|
5
|
|
6 copy($_) foreach @progs;
|
|
7
|
|
8 sub copy {
|
|
9 my $prog = shift;
|
|
10
|
|
11 print STDERR "\r\e[K$prog";
|
|
12
|
|
13 open my $rdr, "<", "old/$prog.txt";
|
|
14 open my $wtr, ">", "final/$prog.txt";
|
|
15 open my $tmp, "<", "new/$prog.txt";
|
|
16
|
|
17 my $out = join "", <$tmp>;
|
|
18
|
|
19 my $progdesc;
|
|
20
|
|
21 while(my $line = readline $rdr) {
|
|
22 if($line =~ /^Description/) {
|
|
23 readline $rdr;
|
|
24 while($line !~ /SOAP/) {
|
|
25 $line = readline $rdr;
|
|
26 last if $line =~ /SOAP/;
|
|
27 $progdesc .= $line;
|
|
28 }
|
|
29 $progdesc =~ s/\n+$//smg;
|
|
30 }
|
|
31 }
|
|
32
|
|
33 $out =~ s/\[ProgDef\]\n/$progdesc/smg;
|
|
34
|
|
35 print $wtr $out;
|
|
36 }
|