delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/04/06/09:05:07

X-Spam-Check-By: sourceware.org
Message-Id: <200604061304.k36D4dqU030525@tigris.pounder.sol.net>
From: cygwin AT trodman DOT com (Tom Rodman)
Reply-to: cygwin AT cygwin DOT com
To: cygwin AT cygwin DOT com
Subject: Re: new gawk & sed in pipes (sed now acts binary; awk now does dos2unix)
In-reply-to: <200604051824.k35IOLTm023813@tigris.pounder.sol.net>
References: <200604051824 DOT k35IOLTm023813 AT tigris DOT pounder DOT sol DOT net>
Date: Thu, 06 Apr 2006 08:04:38 -0500
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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

OK - I read Corinna's ANNOUNCEMENT on gawk-3.1.5-4.  I'll try the BINMODE
variable.

Still not sure about sed, I'll look for a similar variable..

On Wed 4/5/06 13:24 CDT cygwin AT cygwin DOT com wrote:
> The latest versions of gawk and sed appear to have changed how they
> process DOS text STDIN.  This change in behavior has broken some of 
> our scripts.  Is this change in behavior by design?  Can we revert back
> to the old design?
> 
> Pls see test cases below.
> 
> --
> thanks,
> Tom Rodman
> 
> # -------------------------------------------------------------------- 
> # Normal behavior for many past revs of cywgin's gawk and sed:
> #   o sed is *not* binary in pipes (it converts DOS text to UNIX)
> #   o awk is binary in pipes (it leaves line terminators alone)
> #
> #   NOTE that "printf" test below sends 1 DOS line of text (\r\n), and 1 UNIX line
> # -------------------------------------------------------------------- 
> 
>   ~ $ date;uname -a
>   Wed Apr  5 12:43:46 CDT 2006
>   CYGWIN_NT-5.2 OurSrvr063 1.5.19(0.150/4/2) 2006-01-20 13:28 i686 Cygwin
>   ~ $ cygcheck -c|egrep 'gawk|sed'
>   gawk                 3.1.5-2            OK
>   sed                  4.1.4-1            OK
>   ~ $ printf "hi\r\nho\n"|eval sed '/foo/d'|od -c
>   0000000   h   i  \n   h   o  \n
>             h   i  \n   h   o  \n
>   0000006
>   ~ $ printf "hi\r\nho\n"|eval awk '{print}'|od -c
>   0000000   h   i  \r  \n   h   o  \n
>             h   i  \r  \n   h   o  \n
>   0000007
> 
> # -------------------------------------------------------------------- 
> # Problem behavior for new gawk and sed
> #   o sed is now binary in pipes (it leaves line terminators alone)
> #   o awk is *not* binary in pipes (it converts DOS text to UNIX)
> # -------------------------------------------------------------------- 
>   ~ $ date;uname -a
>   Wed Apr  5 12:53:56 CDT 2006
>   CYGWIN_NT-5.0 OurServer108 1.5.20s(0.155/4/2) 20060329 23:02:10 i686 Cygwin
>   ~ $ cygcheck -c|egrep 'gawk|sed'
>   gawk                 3.1.5-4            OK
>   sed                  4.1.5-1            OK
>   ~ $ printf "hi\r\nho\n"|eval sed '/foo/d'|od -c
>   0000000   h   i  \r  \n   h   o  \n
>   0000007
>   ~ $ printf "hi\r\nho\n"|eval awk '{print}'|od -c
>   0000000   h   i  \n   h   o  \n
>   0000006
> 
> 
> --
> 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/
> 

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