add support for #!/usr/bin/env timer.pl
This commit is contained in:
parent
20a3fe9df5
commit
5f55abfa23
1 changed files with 20 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue