logo       

Re: ^M characters: msg#00464

web.webmin.general

Subject: Re: ^M characters

Hello Will,

Thursday, June 27, 2002, 6:21:45 PM, you wrote:

W> ---quote---
W> When i save a text file in NT, i do not see those ^M carriage returns,
W> however, when i move the file to the samba share and use cat, more, or vi, i
W> see carriage returns on every line, how can i remove this automatically?
W> ---end quote---

W> this happens quite a lot. It's because something about windows feels the
W> need to insert both a carriage return and a new line at the end of each line
W> in a text file, while vi only uses one of the above.
W> An easy solution I've found is to use pico (text editor - if you're using
W> debian it's not installed by default, most others it is). Open the file
W> (via pico filename), hit the "write out" command, and it strips it of the
W> control-M characters. Then feel free to vi / vim it to death.
W> I've thought about writing a little script which strips these out, but then,
W> i think, why? Pico works fine.

I don't want to get into the relative merits of vi vs pico, but I do
want people to know you can do the same thing in vi (in ESC mode):

%s/[Control v][Control m]//g

(that is hold the control key down and type v then m).


allan
--
allan
allan@xxxxxxxxx
http://www.allan.org



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Bringing you mounds of caffeinated joy.
http://thinkgeek.com/sf
-
Forwarded by the Webmin mailing list at webadmin-list@xxxxxxxxxxxxxxxxxxxxx
To remove yourself from this list, go to
http://lists.sourceforge.net/lists/listinfo/webadmin-list



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise