This is the mail archive of the
mailing list for the Cygwin project.
RE: end of file characters
- From: "Peter Klavins" <klavins at netspace dot net dot au>
- To: <cygwin at cygwin dot com>
- Date: Sun, 2 Dec 2007 19:20:11 +0100
- Subject: RE: end of file characters
- References: <email@example.com>
> I went with the defaults when installing cygwin. Which means I used
> the recommended unix/binary line feed setting. It sounded like that
> means I get no line-ending translation done by cygwin, which is fine.
> So I open a .bat file and see a bunch of ^Ms at the end of each line.
> Then I open a xml file and don't see them. I was expecting to see
> ^Ms again as the xml file, just like the bat file, was created in a
> windows environment. Is this normal?
Even within the Windows environment if often happens that files don't
have cr-lf line endings. This is especially the case, for example, when
you have saved the file from the internet. And even if you've edited
the file using a Windows editor, they quite often sense the line ending
format and write the file back using the same format. So, yes, it is
possible that you may see .bat files with Ctrl-M's and .xml files
> Another question... When I'm editing a file that has the ^Ms do I
> leave them alone, or delete them? Will I be able to go back and forth
> use vi via cygwin, and notepad/textpad via windows without harming the
In general, you don't really need to delete Ctrl-M's, so long as the
files are working fine as they are. Vi happily reads and writes files
with lines with or without Ctrl-M's. You'll find that Notepad is
useless in editing files without Ctrl-M's, because it treats them as one
long line. But WordPad works fine.
If you must delete the additional Ctrl-M's, don't do it by hand within
an editor, you may accidentally leave one in, which may potentially
later confuse the hell out of an editor, or you. Use a program like
unix2dos/dos2unix to do that work for you.
Peter Klavins Datalon SrL
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html