process-systest.pl from EmStar at Krugle
Show process-systest.pl syntax highlighted
#!/usr/bin/perl
print(" mode = $ARGV[0]\n");
if ($ARGV[0] eq "-old") {
print("****OLD mode\n");
my @explist = split('\n',`ls . | grep "zzz-EXPT"`);
my $item;
system("rm /tmp/systestfile-*");
foreach $item (@explist) {
my @s = split('-', $item);
my @tmp = split(/temp/, $s[2]);
my @tmp2 = split(/hum/, $tmp[1]);
my @tmp4 = split(/wind/, $tmp2[0]);
my $temp = $tmp4[0];
my @tmp3 = split(/wind/, $tmp2[1]);
my $hum = $tmp3[0];
my $wind = $tmp3[1];
print "entry $s[3] is $s[5] from $s[4] temp $temp hum $hum wind $wind \n";
my $i;
for ($i=0; $i<5; $i++) {
my $j = $i + $s[5];
system("echo -e $s[4]\\\\t$j\\\\t0\\\\t0\\\\t0\\\\t$temp\\\\t$hum\\\\tOK >> /tmp/systestfile-$s[3]");
}
}
}
else {
my @explist = split('\n',`ls . | grep "zzz-EXPT"`);
my $item;
system("rm /tmp/systestfile-*");
foreach $item (@explist) {
my @s = split('-', $item);
print "entry $s[2] is $s[4] from $s[3] \n";
my @sendlog = split('\n', `cat sendlog-static-$s[3]-$s[4]`);
my $docoll="";
my $lastidx=5;
my @sendline = split('\t', $sendlog[0]);
if ($sendline[3] == 0) {
print "first is collision.. $sendlog[0]\n";
$lastidx++;
$docoll=",collisiontest";
}
for ($i=0; $i<$lastidx; $i++) {
@sendline = split('\t', $sendlog[$i]);
my $j = $i + $s[4];
system("echo -e $s[3]\\\\t$j\\\\t0\\\\t0\\\\t0\\\\t20\\\\t60\\\\tOK$docoll,$sendline[4] >> /tmp/systestfile-$s[2]");
$docoll="";
}
}
}
See more files for this project here