Advertisement
Guest User

MoveFilesInPerl

a guest
Dec 28th, 2013
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.23 KB | None | 0 0
  1. #!/usr/bin/perl
  2. use File::Copy;
  3.  
  4.  
  5. $in_dir=$ARGV[0];
  6. $dest_dir=$ARGV[1];
  7.  
  8. chdir($in_dir);
  9. @dir_files=<*>;
  10.  
  11. foreach $dir (@dir_files)
  12. {
  13.     if($dir=~/pdf/)
  14.     {
  15.        
  16.        
  17.         move("$dir","$dest_dir") or die "Move failed, $!";
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement