魏长东

weichangdong

perl终端输出带颜色

perl -MTerm::ANSIColor -e  "print color 'bold red';print 'hello';print color 'reset';"
perl -MTerm::ANSIColor -e  "print color 'bold red';print \"no match\t$LINE\";print color 'reset';"

 

批量替换 可用sed实现

perl -pi -e 's/ado_link\(/&ado_link\(/g' `find ./ -type f -a -name "*.php"`
perl -pi.bak -e 's/&\s*ado_link\(/ado_link\(/g' *.php