Skip to content

Instantly share code, notes, and snippets.

@shouhei
Created July 17, 2014 23:14
Show Gist options
  • Select an option

  • Save shouhei/8ba676534dc2012fd542 to your computer and use it in GitHub Desktop.

Select an option

Save shouhei/8ba676534dc2012fd542 to your computer and use it in GitHub Desktop.
指定したファイルを、カレントディレクトリ直下の全ディレクトリにコピーする
#!/usr/bin/perl
binmode STDOUT,":utf8";
use strict;
use warnings;
use utf8;
use File::Copy;
my $file = $ARGV[0];
unless($file){
print "コピーしたいファイル名を指定してください\n";
exit;
}
while(<./*>){
if($_ !~ /\./){
copy "./$file", "./$_/$file" or die $!;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment