|
发表于 2011-8-27 11:39:22
|
显示全部楼层
1 use File::Copy;
2
3 @target = glob "*.tcl";
4 foreach $f (@target) {
5 my $newname = $f;
6 $newname =~ s/\.tcl/\.old/;
7 rename $f, $newname;
8 open OLDFD, "<", $newname;
9 open NEWFD, ">", $f;
10 foreach $line (<OLDFD>) {
11 printf $line;
12 $line =~ s/\/fs\/volume/\/s3g\/project\/vol/g;
13 printf NEWFD $line;
14 }
15 close OLDFD;
16 close NEWFD;
17 }
初学者,练练。 |
|