| 1 | #! /usr/bin/perl -w |
|---|
| 2 | use strict; |
|---|
| 3 | use File::Copy; |
|---|
| 4 | |
|---|
| 5 | my $cmd_string = join (" ",@ARGV); |
|---|
| 6 | my $results = `$cmd_string`; |
|---|
| 7 | my @files = split("\n",$results); |
|---|
| 8 | my $fileNameOut = $ARGV[6]; |
|---|
| 9 | my ($drive, $outputDir, $file) = File::Spec->splitpath( $fileNameOut ); |
|---|
| 10 | my $destination = $fileNameOut; |
|---|
| 11 | |
|---|
| 12 | foreach my $thisLine (@files) |
|---|
| 13 | { |
|---|
| 14 | if ($thisLine =~ /Created /) |
|---|
| 15 | { |
|---|
| 16 | $thisLine =~ /[\w|\.]+$/; |
|---|
| 17 | $thisLine =$&; |
|---|
| 18 | #print "outfile: $thisLine\n"; |
|---|
| 19 | #there is only one file to move, so we can quit after finding it |
|---|
| 20 | move($drive.$outputDir.$thisLine,$fileNameOut); |
|---|
| 21 | exit(1); |
|---|
| 22 | } |
|---|
| 23 | else |
|---|
| 24 | { |
|---|
| 25 | print $thisLine,"\n"; |
|---|
| 26 | } |
|---|
| 27 | } |
|---|