Adding ^M characters in vi

来源:互联网 发布:weui.min.js cdn 编辑:程序博客网 时间:2024/05/18 00:37

Adding ^M characters in vi


This is an obscure one. There are lots of Web pages out there to tell you how to get rid of ^M characters in text files (dos2unix is your friend) but occasionally you need to edit a settings file on UNIX server where the file is normally edited using a Windows client. If you don't add the ^M character at the end of each line, the lines will run together next time the file is viewed in Windows.

To add a ^M in vi enter Ctrl+V followed by Ctrl+M.