add support for #!/usr/bin/env timer.pl

This commit is contained in:
Sears Russell 2009-10-12 22:25:55 +00:00
parent 20a3fe9df5
commit 5f55abfa23

View file

@ -2,6 +2,7 @@
use strict;
my $infile;
my $CI80 = 1;
my $CI90 = 2;
@ -138,6 +139,9 @@ while (@ARGV) {
print "tdist: $tdist\n";
shift @ARGV;
shift @ARGV;
} elsif (-f $ARGV[0] ) {
$infile = $ARGV[0];
shift @ARGV;
}
else {
@ -148,6 +152,20 @@ while (@ARGV) {
parse_t_distribution;
while (my $cmd = <>) {
runbatch($cmd);
if($infile) {
open IN, $infile;
while (my $cmd = <IN>) {
if($cmd !~ /^#/) {
print $cmd;
runbatch($cmd);
}
}
close IN;
} else {
while (my $cmd = <>) {
if($cmd !~ /^#/) {
print $cmd;
runbatch($cmd);
}
}
}