delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/08/22/04:59:38

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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
From: "Hannu E K Nevalainen" <_garbage_collector_ AT telia DOT com>
To: <cygwin AT cygwin DOT com>
Subject: RE: grep: $ in PATTERN doesn't seem to work properly
Date: Sun, 22 Aug 2004 10:58:42 +0200
Message-ID: <NGBBLLIAMFLGJEOAJCCEOEEADNAA._garbage_collector_@telia.com>
MIME-Version: 1.0
In-Reply-To: <20040822000534.GA1110049@hpn5170>
X-IsSubscribed: yes

>> On Sat, 21 Aug 2004, Hannu E K Nevalainen wrote:
>> 
>>> Note that there is a difference depending on how you create the
>>> file; I'll hand over to cygwin-specialists to explain (or ponder
>>> on) why it has to be this way. 
>>> 
>>> I'm running BINARY mounts all over, still I get the behaviour
>>> below.
<SNIP>

> On Sat, Aug 21, 2004 at 07:07:21PM -0400, Igor Pechtchanski wrote:
>> This has to do with the way "cat" behaves.  By default, Windows sends
>> textmode line endings from the console.  Most applications
>> (including od, echo, bash, etc) compensate for this somehow, except
>> "cat", which *always* replicates the output character by character,
>> doing no processing *whatsoever*.  AFAIK, this is by design.
>> 
>> Case in point:
>> 
>> $ od -c
>> <Enter><Ctrl-D>
>> 0000000  \n
>> 0000001
>> $ cat | od -c
>> <Enter><Ctrl-D>
>> 0000000  \r  \n
>> 0000002
>> $ perl -pe 1 | od -c
>> <Enter><Ctrl-D>
>> 0000000  \n
>> 0000001
>> $ # Note, however:
>> $ perl -pe 1 | cat | od -c
>> <Enter><Ctrl-D>
>> 0000000  \n
>> 0000001
>> $
>
> See also <http://www.cygwin.com/ml/cygwin/2003-04/msg02268.html>
> I once sent a patch to a transient coreutils maintainer but
> there was no followup.
> 
> Pierre

$ type -a cat
cat is /usr/bin/cat
cat is /bin/cat
$ cygcheck -f /bin/cat
textutils-2.0.21-1

I would appreciate if this DOS-text-ism could be removed.
Would applying the above patch have hard to handle side effects?
I guess some important scripts could be affected :-7 ...


/Hannu E K Nevalainen, B.Sc. EE Microcomputer systems            --72-->

** mailing list preference; please keep replies on list **

-- printf("LocalTime: UTC+%02d\n",(DST)? 2:1); --
--END OF MESSAGE--

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