Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com To: cygwin AT cygwin DOT com From: Shankar Unni Subject: Re: Grep and matching end of line (anchoring) Date: Fri, 19 Nov 2004 11:21:54 -0800 Lines: 20 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet AT sea DOT gmane DOT 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: 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/