Tuesday, November 2, 2010

Dreaded ^M problem

Just making a quick post for myself in case I encounter this problem in the future

vi -b myfile.sh
:1,$s/^M//g

Quick info: when moving files from windows to unix you may end up getting funny character information in the file. In order to see these characters in vi, we've got to use the -b switch. The second command listed above will automatically find those symbols and remove them.

**The ^M is actually [ctrl]+v and [ctrl]+M**
Source and more information

No comments:

Post a Comment