delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/05/27/20:44:51

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
X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs
Date: Tue, 27 May 2003 20:44:40 -0400 (EDT)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: Tom Rodman <nicebounce AT trodman DOT com>
cc: cygwin AT cygwin DOT com
Subject: Re: binmode() workaround; non ":raw" default- is this a bug or by
design?
In-Reply-To: <200305272153.h4RLrqOu007681@tigris.pounder.sol.net>
Message-ID: <Pine.GSO.4.44.0305272041480.22452-100000@slinky.cs.nyu.edu>
Importance: Normal
MIME-Version: 1.0

On Tue, 27 May 2003, Tom Rodman wrote:

> --------
>
> to review.. the problem (UNIX style lines converted to DOS):
> --v-v------------------C-U-T---H-E-R-E-------------------------v-v--
> bash-2.05b$ printf "\r\n\n"|perl -pe '1;'|od -a
> 0000000  cr  nl  cr  nl
> 0000004
>
> work around:
> --v-v------------------C-U-T---H-E-R-E-------------------------v-v--
> bash-2.05b$ printf "\r\n\n"|perl -pe '
>   BEGIN {
>     binmode (\*STDIN, q{:raw});
>     binmode (\*STDOUT,q{:raw});
>       # would "binmode (STDOUT,q{:raw }); be as good?
>   }
>   1;' | od -a
> 0000000  cr  nl  nl
> 0000003
> bash-2.05b$ perl -v|grep 'This is';uname -r
> This is perl, v5.8.0 built for cygwin-multi-64int
> 1.3.22(0.78/3/2)
> <snipped>
> --^-^------------------C-U-T---H-E-R-E-------------------------^-^--
>
> Comments please.
> Tom

Tom,

Try

$ printf "\r\n\n"|PERLIO=perlio perl -pe '1;'|od -a

(see <http://cygwin.com/ml/cygwin/2003-03/msg01093.html>).
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton


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