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 Reply-To: From: "Jan Schormann" To: Subject: Now I see - was RE: sed-4.1.2-1: backslash in 'i' and 'a' changed? Date: Fri, 10 Sep 2004 13:17:09 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit In-Reply-To: <20040910102754.GA2559@cygbert.vinschen.de> X-OriginalArrivalTime: 10 Sep 2004 11:17:10.0085 (UTC) FILETIME=[B6DFB750:01C49727] X-Spam-Status: No, hits=-103.0 required=6.0 tests=BAYES_20,IN_REP_TO,MSGID_GOOD_EXCHANGE,RCVD_IN_ORBS, USER_IN_WHITELIST version=2.55 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) X-IsSubscribed: yes Hi, sorry, by now even I noticed that this is OT because it depends entirely on upstream. Then again, I found out where I was misunderstanding the documentation, and I'd like to share: I always thought that the '\' after 'a' was denoting a continuation line and could be left out if you put all the text in the same line, which of course I'm always tempted to do when I provide expressions using the '-e' command line switch. Thanks for the enlightenment, Jan. .. Full story: > From `info sed': > > `a\' > `TEXT' > [...] > Escape sequences in TEXT are processed, so you > should use `\\' in TEXT to print a single backslash. Yeah well, so '\\x' should print a single backslash and an 'x', but it doesn't print a backslash at all ... Oh I see, *if* it's the first thing in the argument, where sed 4.1.2 reads it as '\' + '\x' in these examples: $ echo | sed -e 'ix\\x' x\x $ echo | sed -e 'i\\x' x While 3 bs produce the (by me) desired result in both versions: $ echo | sed -e 'i\\\x' x OK, can live with that ;-) -- 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/