
使用Perl的方法:
#!/usr/bin/perl
while(<>){
chop;
print;
print "rn";
}
这个最简单了,使用的时候用管道操作就行了。相反dos2unix的话如下:
#!/usr/bin/perl
while(<>){
s/rn$/n/;
print;
}
另一种使用Perl的方法:
perl -pi -e 's/cM//gs' filelist
这种方法在Window and Unix、下都可以正常使用。filelist 可以采用统配符号。