delorie.com/archives/browse.cgi | search |
X-Recipient: | archive-cygwin AT delorie DOT com |
X-Spam-Check-By: | sourceware.org |
From: | "Dave Korn" <dave DOT korn AT artimi DOT com> |
To: | <cygwin AT cygwin DOT com> |
References: | <18725646 DOT post AT talk DOT nabble DOT com> |
Subject: | RE: Can't use special characters \n or \r |
Date: | Wed, 30 Jul 2008 10:28:00 +0100 |
Message-ID: | <009601c8f226$8f3344c0$9601a8c0@CAM.ARTIMI.COM> |
MIME-Version: | 1.0 |
X-Mailer: | Microsoft Office Outlook 11 |
In-Reply-To: | <18725646.post@talk.nabble.com> |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Id: | <cygwin.cygwin.com> |
List-Unsubscribe: | <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT 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 |
jay3205 wrote on 30 July 2008 04:46: > I have a text file made in Windows, and I'm trying to replace all the > carriage returns with nothing. However, whenever I use \r or \n to > indicate > a carriage return or newline in a grep or sed search string, it is treated > as a normal r and normal n. Anyone have any idea of what may be causing > this? Normal grep and sed don't speak C-style escape chars. Use the -P option for perl regex style in grep and it'll work. Dunno bout sed, but it all gets tangled up in the matching against end-of-line $ anchor. See also "tr -d '\015'", and of course d2u. cheers, DaveK -- Can't think of a witty .sigline today.... -- 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/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |