From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 121205 invoked by alias); 3 Jan 2018 18:45:40 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 121126 invoked by uid 89); 3 Jan 2018 18:45:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.6 required=5.0 tests=AWL,BAYES_40,FREEMAIL_FROM,KAM_MXURI,RCVD_IN_DNSWL_LOW,SPF_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=prince, Prince, Karr, karr X-HELO: omr-a004e.mx.aol.com Received: from omr-a004e.mx.aol.com (HELO omr-a004e.mx.aol.com) (204.29.186.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 03 Jan 2018 18:45:33 +0000 Received: from mtaout-mbc02.mx.aol.com (mtaout-mbc02.mx.aol.com [172.26.221.142]) by omr-a004e.mx.aol.com (Outbound Mail Relay) with ESMTP id 2E51338000B4 for ; Wed, 3 Jan 2018 13:45:32 -0500 (EST) Received: from [192.168.0.3] (unknown [65.189.93.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mtaout-mbc02.mx.aol.com (MUA/Third Party Client Interface) with ESMTPSA id BFC893800008B for ; Wed, 3 Jan 2018 13:45:31 -0500 (EST) Reply-To: tprince@intelretiree.com Subject: Re: Grep can't match characters before EOL marker without ^M To: cygwin@cygwin.com References: From: "arrl via cygwin" Reply-To: arrl Message-ID: <00e694f3-1e50-24be-95dd-8b6bf2bb1323@aol.com> Date: Wed, 03 Jan 2018 18:45:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit x-aol-global-disposition: G x-aol-sid: 3039ac1add8e5a4d24cb2007 X-AOL-IP: 65.189.93.33 X-SW-Source: 2018-01/txt/msg00014.txt.bz2 On 1/3/2018 12:31 PM, David Karr wrote: > My cygwin version appears to be "2.9.0(0.318/5/3)". > > If I have a text file that has a line that ends with "abc", and I try > to grep for "abc$", it doesn't match. I find that it does match "$" > and "abc^M$". > > I've read some of the documentation about line endings in Cygwin. > > I need to write some scripting that works on both Cygwin and Linux. > What do I need to do here? > Consider running dos2unix on files containing ^M at line ends. -- Tim Prince -- 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