delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/02/24/23:37:08

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
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Sun, 24 Feb 2002 23:36:18 -0500
From: Christopher Faylor <cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: "$(dothis)" construct acts as a text tool in pipe (\r removed)
Message-ID: <20020225043618.GB24285@redhat.com>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <030401c1bda0$8659e5a0$5c00a8c0 AT mchasecompaq> <200202250424 DOT WAA09916 AT tigris DOT pounder DOT sol DOT net>
Mime-Version: 1.0
In-Reply-To: <200202250424.WAA09916@tigris.pounder.sol.net>
User-Agent: Mutt/1.3.23.1i

On Sun, Feb 24, 2002 at 10:24:41PM -0600, Tom Rodman wrote:
>I see inconsistent behavior between the two below 1.3.9 commands.  Why
>does the "\r" pass through the pipe in :
>   
>   echo X$'\r'|od -a # \r preserved
>   
>; but not in:
>
>   echo "$(echo X$'\r')" |od -a  # \r deleted
>
>? 

Dunno.

>Earlier this month I pointed out that grep, and sed will strip out \r
>at EOL, but awk, cat, tac, perl, awk, head, tail, and tee pass it
>through.  I believe grep, and sed have been designated "Cygwin text
>tools".  I find this inconsistent, and hard to remember; will someone
>pls explain the reasoning?  Is this stable and intended?

It is intended.

>I would like to see someone smarter than me argue that:
>
>   "\r" at EOL should never being stripped out of a 
>   cygwin binary pipe.  

Dunno if smarter than you but I'm not going to argue that.  I've just
been around long enough to know what results in the fewest number of "It
doesn't work for me!" messages.  The current behavior is close, although
it looks like head, tail, and awk should probably be modified to strip
\r, too.  I don't recall many complaints about them, though, so I guess
it doesn't really matter.

Luckily, if you don't like this behavior, you can build your own
versions of the above commands which do whatever you like.  You don't
have to live with my ideas of how things should work.

It should be pretty trivial to just build the packages and then forget
about it.

In case it isn't obvious, this has been discussed before.  It's pretty
much a general rule in a project this old, that there are reasons for
most things.  That's what the mailing list archives are good for.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.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