delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/12/02/14:20:56

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
From: "Peter Klavins" <klavins AT netspace DOT net DOT au>
To: <cygwin AT cygwin DOT com>
References: <729528 DOT 66694 DOT qm AT web36807 DOT mail DOT mud DOT yahoo DOT com>
In-Reply-To: <729528.66694.qm@web36807.mail.mud.yahoo.com>
Subject: RE: end of file characters
Date: Sun, 2 Dec 2007 19:20:11 +0100
Message-ID: <006f01c8350f$fbc40bd0$f34c2370$@net.au>
MIME-Version: 1.0
X-Mailer: Microsoft Office Outlook 12.0
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT 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
> the
>  ^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
without them.

> 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
> and
>  use vi via cygwin, and notepad/textpad via windows without harming the
>  file?

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 K.
------------------------------------------------------------------------
 Peter Klavins                                              Datalon SrL


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019