?? modify.pl
字號:
#! /usr/local/bin/perl
#
# To use this script, put all files you want to modify into
# a subdirectory modify/ and edit the replacement commands below.
# The modified files will be written into the subdirectory modified/
#
$|=1; # immediate output without buffering;
$files = `find modify`; # the list of all files
@file = split('\n',$files); # splitted into an array
print "\n loop over ".$#file." file(s):";
$i=0;
while($file[0]){ # loop over the files
# search for dangerous things:
$tmp = $file[0];
$tmp =~s/modify\//modified\//;
if($file[0]=~/\//){
#
# to see which files will be used without doing it,
# uncomment the following:
#
# print "\nfile ".$file[0]."->".$tmp."\n"; shift @file; next;
#
open(TMP,">$tmp");
open(FILE,$file[0]);
while(<FILE>){ # loop over the lines of the file
# these are some patterns left from old replacement operations:
#
# typical swap command: Edge <-> Line
# s/Edge/qwert/g;
# s/Line/Edge/g;
# s/qwert/Line/g;
# typical more complex replacement: cnd(x) -> nData[x]
# s/cnd\(([^\)]*)\)/nData\[$1\]/g;
# now this is what I want to do in the next big replacement operation:
s/ogenBasic/ogenOctree/g;
s/addRegion/addBox/g;
s/setBox/setBorder/g;
s/setFaceOfRegion/setFaceOfBox/g;
# s/wz/cog/g;
# what remains can be left unchanged:
print TMP;
}
close(TMP); close(FILE);
print "\b"; #print $('-','\\','|','/')[$i]; $i++; $i=0 if ($i==4);
if ($i==0) {print '-'; $i=1;}
elsif($i==1) {print '\\';$i=2;}
elsif($i==2) {print '|'; $i=3;}
elsif($i==3) {print '/'; $i=0;}
}
shift @file;
}
print "\n";
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -