Created
July 17, 2014 23:14
-
-
Save shouhei/8ba676534dc2012fd542 to your computer and use it in GitHub Desktop.
指定したファイルを、カレントディレクトリ直下の全ディレクトリにコピーする
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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