30 lines
683 B
Perl
30 lines
683 B
Perl
|
|
|
|
while(<STDIN>) {
|
|
chomp;
|
|
# najpierw nazwa pliku zrodlowego out
|
|
if($_ =~ /^[^:]*\:\s*(.*)$/) {
|
|
my $line = $1;
|
|
# print "TEXT: $line\n";
|
|
# teraz tylko samo polecenie
|
|
if($line =~ /\`\s*(.+)\s*\`/) {
|
|
my $cmd = $1;
|
|
# print "CMD: $cmd\n";
|
|
# teraz splitujemy potoki
|
|
my @progs = split(/\s*\|\s*/, $cmd);
|
|
foreach (@progs) {
|
|
# print "$_\n";
|
|
# ucinamy agrumenty programu
|
|
# oraz linie, zawierajace nie-programy (--replace, $tmpfile_x, /g, \\, itp.)
|
|
if($_ =~ /^([^\$\\\/\s\']+)(\s.*)?$/) {
|
|
my $app = $1;
|
|
# print "APP: $app\n";
|
|
# my $res = `which $app`;
|
|
# print "WYNIK: $res\n";
|
|
print "$app\n";
|
|
}
|
|
} # foreach
|
|
}
|
|
}
|
|
}
|