Solaris替换文件内容:将PM_201204240600-201204240700_135中2012-04-24替换为2012-04-26
sed 's/'2012-04-24'/'2012-04-26'/g' PM_201204240600-201204240700_135.xml>PM_201204260600-201204260700_135.xml
将匹配文本替换为换行:
rx6600-1#[/tmp/bwztmp]cat a.txt
dabcabcabc
rx6600-1#[/tmp/bwztmp]awk '{gsub(/a/,"\na");print}' a.txt>b.txt
rx6600-1#[/tmp/bwztmp]cat b.txt
d
abc
abc
abc
rx6600-1#[/tmp/bwztmp]