标签:each Fix use open file get foreach gre usr
#!/usr/bin/perl
use File::Basename;
my $result_dir = $ARGV[0];
my $result_testlog_dir = "$result_dir/testlog";
opendir DIR, $result_testlog_dir;
my $result_log_file = "$result_dir/regress_result.log"
system("touch $result_log_file");
my $all_results;
foreach $file(readdir DIR) {
my ($filename, $dir, $suffix) = fileparse($file, qr/\.[^.]*/);
if($suffix =~ /log/) {
my $result = `grep "TEST_RESULTS" $result_testlog_dir/$file`;
chomp($result);
$all_results = $all_results."$results $result_testlog_dir/$file\n";
}
}
open(WR_FILE, ">$result_log_file");
print WR_FILE, $all_results;
print "RESULT FILE: $result_log_file\n"
标签:each Fix use open file get foreach gre usr
原文地址:https://www.cnblogs.com/bky-lxin/p/9205152.html