From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta001.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) by sourceware.org (Postfix) with ESMTPS id 342F4385454F for ; Thu, 17 Nov 2022 17:29:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 342F4385454F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=SystematicSw.ab.ca Authentication-Results: sourceware.org; spf=none smtp.mailfrom=systematicsw.ab.ca Received: from shw-obgw-4002a.ext.cloudfilter.net ([10.228.9.250]) by cmsmtp with ESMTP id veQmo5yWaMsxDvii2oychV; Thu, 17 Nov 2022 17:29:54 +0000 Received: from [10.0.0.5] ([184.64.124.72]) by cmsmtp with ESMTP id vii1oaiIVomIwvii1o9Pb3; Thu, 17 Nov 2022 17:29:54 +0000 X-Authority-Analysis: v=2.4 cv=LM91/ba9 c=1 sm=1 tr=0 ts=63766f92 a=oHm12aVswOWz6TMtn9zYKg==:117 a=oHm12aVswOWz6TMtn9zYKg==:17 a=IkcTkHD0fZMA:10 a=w_pzkKWiAAAA:8 a=IC_739QHJjyCLqWiG04A:9 a=QEXdDO2ut3YA:10 a=ZIGPnEnQmisA:10 a=vmOwH9HAGyUA:10 a=FBNtmh7_lDcA:10 a=sRI3_1zDfAgwuvI8zelB:22 Message-ID: <504897c2-4f80-7441-6156-5b3788446ba4@SystematicSw.ab.ca> Date: Thu, 17 Nov 2022 10:29:53 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 From: Brian Inglis Subject: Re: --text option of grep v3.7-2 not stripping CR from EoL Reply-To: cygwin@cygwin.com To: cygwin@cygwin.com Content-Language: en-CA In-Reply-To: <20221115062231.qyxi5n7imx4jh4ih@math.berkeley.edu> Organization: Systematic Software Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4xfM4QuhWo4JN4Lz0yDFhCzvnPeMyfkNS8kYlbN/LJkHdsm/z0mBroBT9TO5DlZurFLqq3dd4lwzzT8F7kRdSuD5HGW9HxhHR+ryUyczRS1aHmyjfbZS3/ iwTdCYj8wQrlKL2JL4b+/HzQX5pXilOQQ7QCiVtBeL1kpp9QQ9Rs/xJvvpB6mfgM+l1a74AmYRqY457lxk5gOEharlg8A0r46bg= X-Spam-Status: No, score=-1163.6 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Mon, 14 Nov 2022 22:22:31 -0800, Ilya Zakharevich wrote: > grep with -a (or --text) option does not strip CR from line ends That has been the case for over five years, as discussed about 2017-02, decided and announced in utilities releases that month (gawk, grep, sed) and earlier in bash IIRC, to avoid corrupting files and pipeliness by doing so, and for compatibility with other non-Windows systems; see discussions in threads: https://cygwin.com/legacy-ml/cygwin/2017-02/msg00152.html https://cygwin.com/legacy-ml/cygwin/2017-02/msg00188.html https://cygwin.com/legacy-ml/cygwin/2017-02/msg00189.html > This does not emit anything (contrary to the man page, which says: > If grep decides the file is a text file, it strips the CR > characters from the original file contents (to make regular > expressions with ^ and $ work correctly). That is under -U, --binary, where it also says: "This option has no effect on platforms other than MS-DOS and MS-Windows." Cygwin does not operate as DOS nor Windows, but does offer text mounts, which may still strip CRs from CR-LF EoL markers in *files*. -- Take care. Thanks, Brian Inglis Calgary, Alberta, Canada La perfection est atteinte Perfection is achieved non pas lorsqu'il n'y a plus rien à ajouter not when there is no more to add mais lorsqu'il n'y a plus rien à retirer but when there is no more to cut -- Antoine de Saint-Exupéry