Whoops. Forgot to add this perl script :-/

This commit is contained in:
Stefan `Sec` Zehl 2012-01-02 20:37:46 +01:00
parent 0dbfe1fcd2
commit a6051b6ac0
1 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,28 @@
#!/usr/bin/perl
use strict;
my($src,$dst,@files)=@ARGV;
my %allfiles;
my $dh;
opendir($dh, $src) || die "source dir missing";
%allfiles=map {$_ => 1} grep {/^[^.]/} readdir($dh);
close $dh;
my @dwim;
for (@files){
if(!$allfiles{$_}){
warn "$_ not found in $src\n";
}else{
push @dwim,$_;
};
};
for (sort keys %allfiles){
push @dwim,$_;
};
system("cp",(map {$src."/".$_} @dwim),$dst);