delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2018/12/17/07:23:05

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:content-type:mime-version:subject:from
:in-reply-to:date:cc:content-transfer-encoding:message-id
:references:to; q=dns; s=default; b=WmiPhMPtGbTkntvPV6ToFCuCTgbE
ajkvf/q4U5Q9UuhP/D/o8MHom5IO1pcDgxSbD1qg3YZXLxIOQQ2xLaTtBoOFQosB
C1r2JZ+/o4zyrb4wHqbzrRMX0ZnKyDqftiHnFI5dtfgPdoOdDvVqEAliciPgTTWl
8A8Co4ZQwbK6TBY=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:content-type:mime-version:subject:from
:in-reply-to:date:cc:content-transfer-encoding:message-id
:references:to; s=default; bh=p5P8HQE9CXLEzrDwS0fFGU0IgQ4=; b=p5
R5stEAOXVhBpr60bDk+ekjqPBX+tQoa2zzmnjDeJeZUfnsTqsDrCE+pVKaib9/Xs
l6zydE9+FF9HL5/fw4S0kIh/+YBvxhWVZ3GNCpi2i1CpONlBpn5vhznTgRxpkrab
KkuImAAcBUXlnq31eaTwMP2zc4m0za6FNSmq98K4g=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.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
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FROM_EXCESS_BASE64,SPF_PASS autolearn=no version=3.3.2 spammy=slap, sk:michael, physical, dear
X-HELO: mx.pao1.isc.org
Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\))
Subject: Re: grep 3.0-2 not stripping CRs on Windows
From: =?utf-8?B?T25kxZllaiBTdXLDvQ==?= <ondrej AT isc DOT org>
In-Reply-To: <0F7D3B1B3C4B894D824F5B822E3E5A178FCF7C86@IRSMSX102.ger.corp.intel.com>
Date: Mon, 17 Dec 2018 13:22:48 +0100
Cc: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Message-Id: <35FC3865-8891-4058-86DF-DA5F1DEFAFD4@isc.org>
References: <BCB16CA2-0472-4566-B652-3951A2939FCE AT isc DOT org> <0F7D3B1B3C4B894D824F5B822E3E5A178FCF7C86 AT IRSMSX102 DOT ger DOT corp DOT intel DOT com>
To: "Soegtrop, Michael" <michael DOT soegtrop AT intel DOT com>
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id wBHCN4ns000464

Hi Michael,

ah, there was a similar change for sed, that’s why I missed it when searching for the change.

I believe this is slightly different case, as the pipes were only included in the example I sent.  The grep fails to match CRLF to $ even if physical files are involved and `-a` option is enforced:

# Create file with CRLF
$ echo -ne 'foo\r\n' > crlf.txt

# Use 2.27-2 version -> works OK
$ ./grep-2.27-2.exe 'foo$' crlf.txt
foo

# Use --binary —> doesn’t find anything OK
$ ./grep-2.27-2.exe -U 'foo$’ crlf.txt

# Use —text —> finds the text OK
$ ./grep-2.27-2.exe -a 'foo$' crlf.txt
foo

# No amount of options makes the grep find the text in the file
$ ./grep-3.0-2.exe 'foo$’ crlf.txt
$ ./grep-3.0-2.exe -U 'foo$' crlf.txt
$ ./grep-3.0-2.exe -a 'foo$’ crlf.txt

So. I would be perfectly fine, if I had to slap `-a` to every grep command reading text output, because the default has changed.

Sed doesn’t have --text option, so sure, there’s no other option available.

Thanks,
Ondrej
--
Ondřej Surý
ondrej AT isc DOT org

> On 17 Dec 2018, at 13:04, Soegtrop, Michael <michael DOT soegtrop AT intel DOT com> wrote:
> 
> Dear Ondrej,
> 
> this has been discussed to quite some length and detail more than once on this list. The initial message of a lengthy discussion (> 30 replies) on the topic is here:
> 
> https://www.cygwin.com/ml/cygwin/2017-06/msg00040.html
> 
> Best regards,
> 
> Michael
> Intel Deutschland GmbH
> Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
> Tel: +49 89 99 8853-0, www.intel.de
> Managing Directors: Christin Eisenschmid
> Chairperson of the Supervisory Board: Nicole Lau
> Registered Office: Munich
> Commercial Register: Amtsgericht Muenchen HRB 186928


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019