delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2018/01/03/13:45:52

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:reply-to:subject:to:references:from:reply-to
:message-id:date:mime-version:in-reply-to:content-type
:content-transfer-encoding; q=dns; s=default; b=M/08eakQlmKW0WwR
jMNXv6UjaUX/H7LPgvw410Blqspqtf+MTwvhrFZLaAtW6URSX41NtJwnN+uHxmjJ
NKnP47zWJKIslV3Oq4KtEMXgibX9Bz28Bjc64ZtldcJjw/URCWJcJyBd6HJhl8jl
1ZJFm7INZ2t7k4lfOY15fPzWQnA=
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:reply-to:subject:to:references:from:reply-to
:message-id:date:mime-version:in-reply-to:content-type
:content-transfer-encoding; s=default; bh=xqhsJk4XW8nokVjiU44/Ug
gtJ5U=; b=hP4uPkC3vq+CdYlb6ca/C7Je9sD5KNs1HZBTRBG95BkjgqBSbR7lbF
A9pq1r+OMrFMFsD6h+61NAJHDxmbyFkhCWB+t/cIUZppCk92xWefSzIeVso5r5LS
yAHuvY7O6zlnPi2tBUWxRIDsXApZUjedDV6XBnhjSFdPFna9Eq8Fg=
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-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
Reply-To: tprince AT intelretiree DOT com
Subject: Re: Grep can't match characters before EOL marker without ^M
To: cygwin AT cygwin DOT com
References: <CAA5t8Vrr_GcYqaLq-1noAj7mxQ7KsMnd43k10-ef1anuCr60Tg AT mail DOT gmail DOT com>
From: "arrl via cygwin" <cygwin AT cygwin DOT com>
Reply-To: arrl <n8tm AT aol DOT com>
Message-ID: <00e694f3-1e50-24be-95dd-8b6bf2bb1323@aol.com>
Date: Wed, 3 Jan 2018 13:39:21 -0500
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: <CAA5t8Vrr_GcYqaLq-1noAj7mxQ7KsMnd43k10-ef1anuCr60Tg@mail.gmail.com>
x-aol-global-disposition: G
x-aol-sid: 3039ac1add8e5a4d24cb2007
X-AOL-IP: 65.189.93.33

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

- Raw text -


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