logo       

^M characters: msg#00463

web.webmin.general

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



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

News | FAQ | advertise