logo       

RE: ^M characters: msg#00465

web.webmin.general

Subject: RE: ^M characters

Grab MultiEdit at www.multiedit.com. it's the best. It'll also allow you
to save in windows or unix.

-----Original Message-----
From: webadmin-list-admin@xxxxxxxxxxxxxxxxxxxxx
[mailto:webadmin-list-admin@xxxxxxxxxxxxxxxxxxxxx] On Behalf Of Will
Sent: Thursday, June 27, 2002 5:22 PM
To: webadmin-list@xxxxxxxxxxxxxxxxxxxxx
Subject: ^M characters


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

this happens quite a lot. It's because something about windows feels
the need to insert both a carriage return and a new line at the end of
each line in a text file, while vi only uses one of the above. An easy
solution I've found is to use pico (text editor - if you're using debian
it's not installed by default, most others it is). Open the file (via
pico filename), hit the "write out" command, and it strips it of the
control-M characters. Then feel free to vi / vim it to death. I've
thought about writing a little script which strips these out, but then,
i think, why? Pico works fine. Also, the ^M characters don't usually
disturb anything, most programs read past them. If you're using perl,
with it's syntax nightmares (sorry jamie), you might have problems with
it literally interpreting them and adding lines where you didn't mean
to, but this usually doesn't happen.

Not that i'm knocking perl, mind you, I just don't understand it. I'm
learning, but i'm still intimidated by the ammount of punctuation.

~Will



-------------------------------------------------------
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



-------------------------------------------------------
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