Removing Line Feeds (^M) from scripts
I don't know vi. But it has its uses. I like "mc" and "ee".
However, knowing a little "vi" is sometimes helpful. Here's a lazy way
of knowing only what you have to:
Using "mc", move the cursor to the file that needs to have the ^M's removed.
press F2 This invokes the user menu in mc
press @ This tells mc you want to invoke a command
type vi This invokes the vi editor
type :%s/^v^m//g This does a search/replace of all ^m with nothing
type :wq This writes to the file, then quits
Note: ^v means to press control-v (^m means to press control-m)
If you are using a fairly new version of midnight commander, you may find that you will have to invoke the vi editor manually for the above search/replace command to function correctly.