From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 39722 invoked by alias); 3 Jan 2018 17:56:37 -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 39711 invoked by uid 89); 3 Jan 2018 17:56:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.5 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=brian, Brian, calgary, Calgary X-HELO: smtp-out-no.shaw.ca Received: from smtp-out-no.shaw.ca (HELO smtp-out-no.shaw.ca) (64.59.134.13) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 03 Jan 2018 17:56:35 +0000 Received: from [192.168.1.100] ([24.64.240.204]) by shaw.ca with ESMTP id WnHEeHkXGZ8gBWnHFe96cq; Wed, 03 Jan 2018 10:56:34 -0700 X-Authority-Analysis: v=2.2 cv=M/g9E24s c=1 sm=1 tr=0 a=MVEHjbUiAHxQW0jfcDq5EA==:117 a=MVEHjbUiAHxQW0jfcDq5EA==:17 a=N659UExz7-8A:10 a=w5aJ8kaLLAry8Qfnm_kA:9 a=pILNOxqGKmIA:10 Reply-To: Brian.Inglis@SystematicSw.ab.ca Subject: Re: Grep can't match characters before EOL marker without ^M To: cygwin@cygwin.com References: From: Brian Inglis Message-ID: <9391def3-f324-e8fd-ff5d-76fc8848dcca@SystematicSw.ab.ca> Date: Wed, 03 Jan 2018 17:56:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfHDCfGAnHjRwyVCWTu7j0wiwaiDzykk0QpWp92Jt4r2Zw+2UXVQVSCd25W8QbWgc9IToPPGdnxYM9/EM9+ecxUu9LTjldhZQcx18prQmcbjXbRF0nzVi RyfbFFE3AjgzDomsuXI7DWK3TfQVxkbGNWlCxooZWlfo9jI/O1/QnhZVdRlKSWcgWbWPXTAN4+K5+g== X-IsSubscribed: yes X-SW-Source: 2018-01/txt/msg00013.txt.bz2 On 2018-01-03 10:31, David Karr wrote: > 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? Use grep '...[[:cntrl:]]\?$' to match, d2u|dos2unix or sed 's/\r$//' to remove. -- Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada -- 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