该篇为Unix下进行dos转unix格式的Unix shell。
1,单个文件
dos2unix [srcFile] > [targetFile]
eg.
dos2unix Reporter.java > Reporter.java.back
dos2unix -437 Reporter.java Reporter.java
2, 批量文件
#!/bin/sh
filelist=`find . -name '
*.java'`
for filename in $filelist
do
dos2unix -437 $filename $filename
echo 'convert '$filename
done
echo 'Finished!'
Thanks for Kevin and xiao si's help!