Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
To: cygwin@cygwin.com
From: Shankar Unni <shankarunni@netscape.net>
Subject: Re: Grep and matching end of line (anchoring)
Date: Fri, 19 Nov 2004 11:21:54 -0800
Lines: 20
Message-ID: <cnlh4j$1kf$1@sea.gmane.org>
References: <F76C9B2DA2FC4C4CA0A18E288BBCBCF71026EB0B@nihexchange24.nih.gov> <NUTMEGc0xvlUQ9cAgjH000000f0@NUTMEG.CAM.ARTIMI.COM>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: usenet@sea.gmane.org
X-Gmane-NNTP-Posting-Host: adsl-68-120-146-125.dsl.snfc21.pacbell.net
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041103 Thunderbird/0.9 Mnenhy/0.6.0.101
In-Reply-To: <NUTMEGc0xvlUQ9cAgjH000000f0@NUTMEG.CAM.ARTIMI.COM>
X-IsSubscribed: yes

Dave Korn wrote:

>   What makes you think grep understands ^ notation to indicate control
> chars?  It doesn't say so in the info page.  (It doesn't recognize [\r]
> either.)

Umm, you're probably jumping to the wrong conclusion about the OP's intent.

He probably meant the literal character ^M, which you have to enter as 
^V^M (control-v control-m) on the command line.

And you have to *pipe* the input into grep, not pass in the file as a 
command line (in textmode mounts, this will cause grep to read the file 
as a text file).

This works just fine:

    cat test.dos.txt | grep 'ld^M$'

*if* you entered ^M on the commnand line as Control-V Control-M.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

