#!/usr/bin/perl/perl
$dest=$ARGV[$#ARGV];
for($i=0;$i<$#ARGV;$i++) {
  $ARGV[$i]=~tr/A-Z/a-z/;
  $path=$ARGV[$i];
  $path=~s/\/$//;
  $path=~s/\/[^\/]*$//;
  $fn=$ARGV[$i];
  $fn=~s/.*\/([^\/]*)$/\1/;
  ($fn,$ext)=split(/\./,$fn);
  $ARGV[$i]=$path."/".substr($fn,0,8).($ext ne "" ? "." . substr($ext,0,3) : "");
}
$cmd="cp -p ".join(' ',@ARGV);
print "[$cmd]","\n";
system($cmd);
