delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/03/31/05:01:26

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
From: "Dave Korn" <dk AT artimi DOT com>
To: <cygwin AT cygwin DOT com>
Subject: RE: Cygwin perl not understanding textmode
Date: Wed, 31 Mar 2004 11:00:08 +0100
MIME-Version: 1.0
In-Reply-To: <4069CAB5.2000603@veritas.com>
Message-ID: <NUTMEGYNX6Mma0n7J95000002be@NUTMEG.CAM.ARTIMI.COM>
X-OriginalArrivalTime: 31 Mar 2004 10:00:08.0828 (UTC) FILETIME=[F30E9BC0:01C41706]

> -----Original Message-----
> From: cygwin-owner On Behalf Of Mike Spertus
> Sent: 30 March 2004 20:30

> > On Tue, 30 Mar 2004, Mike Spertus wrote:
> >
> >> I have installed Cygwin with DOS linebreaks (i.e., disks 
> mounted in 
> >> textmode). However, Cygwin perl doesn't seem to understand this as 
> >> shown below. How do I tell Cygwin perl to respect textmode?:
> >>
> >> MPS AT MPS-2000 ~
> >> $ od -t x1 foo.txt
> >> 0000000 66 6f 6f 62 61 72 0d 0a 66 6f 6f 62 61 7a 0d 0a 
> 0000020 66 6f 
> >> 6f 62 61 74 0d 0a 0d 0a
> >> 0000032
> >>
> >> MPS AT MPS-2000 ~
> >> $ cat ~/foo.txt | perl -e 'while (<>) {print;}' >bar.txt
> >>
> >> MPS AT MPS-2000 ~
> >> $ od -t x1 bar.txt
> >> 0000000 66 6f 6f 62 61 72 0d 0d 0a 66 6f 6f 62 61 7a 0d 
> 0000020 0d 0a 
> >> 66 6f 6f 62 61 74 0d 0d 0a 0d 0d 0a
> >> 0000036

  ISTM to have entirely correctly converted LF to CRLF, which is what
textmode means AFAIUI.  What were you hoping for?


    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