delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/04/28/09:17:12

X-Spam-Check-By: sourceware.org
From: "Dave Korn" <dave DOT korn AT artimi DOT com>
To: <cygwin AT cygwin DOT com>
References: <679468866 AT web DOT de>
Subject: RE: Perl: Carriage Return???
Date: Sat, 28 Apr 2007 14:16:32 +0100
Message-ID: <033401c78997$71c08d60$2e08a8c0@CAM.ARTIMI.COM>
MIME-Version: 1.0
X-Mailer: Microsoft Office Outlook 11
In-Reply-To: <679468866@web.de>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT 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

On 28 April 2007 11:15, Alexander Konig wrote:

> I cannot imagine what is going wrong with that. Why some parts are just
> overwritten. 

  You have dos-style CRLF line endings instead of posix-style LF line endings.
Run 'd2u' on your input file.

> The same code using Active Perl works. Some weeks ago this script has
> worked using Cygwin, too. 

  Active Perl is win32, so it expects CRLF.  Without knowing more I can't say
why it used to work on cygwin and now doesn't, but among the possibilities are
1) you were using a different input file back then and now you're using a
different one with different line-ends 2) you're using the same file, but in
the past weeks you used notepad or wordpad or some other windows file editor
that changes line endings to CRLF on it, 3) you've upgraded your system
version of bash past the recent change where it stopped accepting CRs by
default 4) you could have been running it on a textmode mountpoint previously
and now you're on a binary one 5) you're using cat with backticks in the shell
construct that you feed the file to the script and cat operating in binary
mode preserves CRLFs.

> Then, I wanted to check a regular expression with this script I had to see
> this weird output. 

  Overwritten messages are almost always a sign of CRLF problems.


    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


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