diff options
author | phikoehn <pkoehn@inf.ed.ac.uk> | 2012-06-26 02:38:46 +0400 |
---|---|---|
committer | phikoehn <pkoehn@inf.ed.ac.uk> | 2012-06-26 02:38:46 +0400 |
commit | 7cd83567523aba0bea371e32ae4d3282f3bbf34d (patch) | |
tree | 5730591c64c1bba085ccf6bc1e5e0970513feafa /scripts/ems | |
parent | 135e38d355b4bafbb54b4fc29798da548e762a55 (diff) |
minor bug fixes
Diffstat (limited to 'scripts/ems')
-rwxr-xr-x | scripts/ems/support/run-command-on-multiple-refsets.perl | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/scripts/ems/support/run-command-on-multiple-refsets.perl b/scripts/ems/support/run-command-on-multiple-refsets.perl index 7590e72a1..972f5602d 100755 --- a/scripts/ems/support/run-command-on-multiple-refsets.perl +++ b/scripts/ems/support/run-command-on-multiple-refsets.perl @@ -7,13 +7,18 @@ die("ERROR: syntax: run-command-on-multiple-refsets.perl cmd in out") my ($cmd,$in,$out) = @ARGV; die("ERROR: attempt to run on multiple references, but there is only one") - if -e $in && ! -e "$in.ref0"; -die("ERROR: did not find reference '$in.ref0'") - unless -e "$in.ref0"; + if -e $in && (! -e "$in.ref0" || -e $in."0"); +die("ERROR: did not find reference '$in.ref0' or '${in}0'") + unless (-e "$in.ref0" || -e $in."0"); -for(my $i=0;-e "$in.ref$i";$i++) { +for(my $i=0;-e "$in.ref$i" || -e $in.$i;$i++) { my $single_cmd = $cmd; - $single_cmd =~ s/mref-input-file/$in.ref$i/g; + if (! -e "$in.ref$i") { + $single_cmd =~ s/mref-input-file/$in$i/g; + } + else { + $single_cmd =~ s/mref-input-file/$in.ref$i/g; + } $single_cmd =~ s/mref-output-file/$out.ref$i/g; system($single_cmd); } |