dos2unix

Information

A few ways to remove dos-formatted linebreaks (^M) from your code.

Procedure

  • the culprit - ^M - is actually two characters: ^v and ^m
    • ^v is Ctrl+V
    • ^m is Ctrl+M

vi

  • search for ^M and replace it with nothing:
    :%s/^v^m//g

perl

  • same as vi:
    perl -pi -e "s:^v^m::g" <filenames>
freebsd/dos2unix.txt · Last modified: 2007/09/28 03:13 by john
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki