copylearnedweights 551 B

123456789101112131415161718192021222324252627
  1. #!/usr/bin/perl -w
  2. if ($#ARGV != 0 ) #check correct number of arguments
  3. {
  4. print "error: wrong number of arguments\n";
  5. print "usage: copylearnedweights <TrialNr>\n\n";
  6. exit(5);
  7. };
  8. my($TrialString)="$ARGV[0]";
  9. my($slen) = length($TrialString);
  10. print "Stringlänge= $slen\n";
  11. my(@files) = glob "*weights.dat$TrialString";
  12. my($src);
  13. my($dst);
  14. foreach $src (@files)
  15. {
  16. $dst = substr($src,0,length($src)-$slen);
  17. # print "sourcefilename=$src targetfilename=$dst\n";
  18. print "cp -r $src $dst\n";
  19. system("cp -r $src $dst");
  20. }
  21. print "fertig\n\n";