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

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:from:to:cc:subject:date:message-id:references
:in-reply-to:content-type:mime-version
:content-transfer-encoding; q=dns; s=default; b=UcrVQMZKL4Ykaufu
CJsAgq+iYVoRaaxDQwuVPehukwEOL5KRh5ktvScLZ+U4Yre6coYbXaODx01WvJh5
W7vKMWnoxTiPedYFwaHD3pibOeI+mkZzW4L3e/juTRmY0Mua7KKdk7zqw5fDEFjJ
wzwcK1CN26Ff6Esi7BgDFdwSGHo=
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:from:to:cc:subject:date:message-id:references
:in-reply-to:content-type:mime-version
:content-transfer-encoding; s=default; bh=fJW7rJoiYSdiC9KbLRpbH9
VHjkU=; b=xsn0pLHYczizUPxQWpdnZTG870Z67MXaA4uL+lY5OBMtsCHjbVE6G7
BCXzxBKChSYM63wYWQBNjgOFEi1OIQJYR5/c55/yxYGgQSGWw+Mk0YMdEXauq9/9
oNwfy/0pDHPnSIycx9Y21C0Chw8Z9x51tJbPVOox4BzYJ/N+NTB8E=
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=-1.9 required=5.0 tests=BAYES_00,MIME_BASE64_BLANKS,SPF_PASS autolearn=ham version=3.3.2 spammy=influence, decisions, dear, Tel
X-HELO: mga14.intel.com
From: "Soegtrop, Michael" <michael DOT soegtrop AT intel DOT com>
To: =?utf-8?B?T25kcmVqIFN1csO9?= <ondrej AT isc DOT org>
CC: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Subject: RE: grep 3.0-2 not stripping CRs on Windows
Date: Mon, 17 Dec 2018 12:50:23 +0000
Message-ID: <0F7D3B1B3C4B894D824F5B822E3E5A178FCF7CFC@IRSMSX102.ger.corp.intel.com>
References: <BCB16CA2-0472-4566-B652-3951A2939FCE AT isc DOT org> <0F7D3B1B3C4B894D824F5B822E3E5A178FCF7C86 AT IRSMSX102 DOT ger DOT corp DOT intel DOT com> <35FC3865-8891-4058-86DF-DA5F1DEFAFD4 AT isc DOT org>
In-Reply-To: <35FC3865-8891-4058-86DF-DA5F1DEFAFD4@isc.org>
MIME-Version: 1.0
X-IsSubscribed: yes
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id wBHCq10r004591

Dear Ondrej,

> # Use —text —> finds the text OK

Afaik -a / --text only suppresses this behavior (from man grep):

             ... when grep discovers that a file is binary  it  suppresses  any  further
              output,  and instead outputs either a one-line message saying that a binary file matches, or no message
              if there is no match.

It does not influence if the file is opened as text or binary file. I agree that the documentation to -U in man grep explicitly says that if a file is a text file, CRs are stripped, so that is a documentation bug. This should be updated (as Corinna already suggested).

I still think that it would also make sense to:

- have for grep, sed and awk at least an option to strip CRs
- have an environment variable to make this option default

But otherwise I must admit that handling scripts intended for Unix works very well with Cygwin so the decision made appear to be good decisions, even if they are sometimes not what one wants.

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