« Calgary Roughnecks | Main | What I'm listening to: "Lostprophets - The Betrayed" »

Removing CTRL M characters

Sometimes if you modify or create a file in Windows or DOS and then copy it to a Linux (well Unix like) file system you get ^M characters at the end of each line. These are annoying when trying to run scripts on files (or things like latex) and can be nicely removed using the vi editor. Open you file with vi and then do:

ESC:%s/^M//g

You can get the ^M by pressing Ctrl V and then Ctrl M.

TrackBack

TrackBack URL for this entry:
http://www.krioma.net/cgi-bin/mt_new/mt-tb.cgi/438

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About

This page contains a single entry from the blog posted on April 17, 2010 5:08 PM.

The previous post in this blog was Calgary Roughnecks.

The next post in this blog is What I'm listening to: "Lostprophets - The Betrayed".

Many more can be found on the main index page or by looking through the archives.

Get Firefox! Valid XHTML 1.0! Valid CSS! RSS Feed BlogUniverse - listed Powered by Apache Creative Commons License ringsofsaturnrock's Most Interesting Photos on Flickriver

Powered by
Movable Type 3.33