Monday, April 17, 2006

A great tip ^M

Today I spent a while fixing the famous ^M problem when copying file from DOS to Unix.

Find two solutions:
1. Use dos2unix command can convert a dos file to unix format (removing annoying ^M)
2. Since originally the dos files are introduced through CVS checkin. If I change the the file type from "binary" to "ASCII" in eclipse. CVS will figure out the file format and automatically remove ^M for me.

One note:
If you open a dos file using vi in Unix environment. vi won't show ^M for you since vi will open the file as dos format. I didn't know this initially.

No comments: