From owner-freebsd-questions@FreeBSD.ORG Sun Mar 14 16:46:25 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4CB8A16A4CE for ; Sun, 14 Mar 2004 16:46:25 -0800 (PST) Received: from mail.mi.celestial.com (dagney.celestial.com [192.136.111.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id 37D9143D41 for ; Sun, 14 Mar 2004 16:46:25 -0800 (PST) (envelope-from bill@celestial.com) Received: by mail.mi.celestial.com (Postfix, from userid 203) id 062F611E8A0; Sun, 14 Mar 2004 16:46:24 -0800 (PST) Date: Sun, 14 Mar 2004 16:46:24 -0800 From: Bill Campbell To: "Steven N. Fettig" , freebsd-questions@freebsd.org Message-ID: <20040315004624.GA82408@alexis.mi.celestial.com> Mail-Followup-To: "Steven N. Fettig" , freebsd-questions@freebsd.org References: <4054DD10.5060504@stevenfettig.com> <20040314164347.X35552@wonkity.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040314164347.X35552@wonkity.com> User-Agent: Mutt/1.4.1i Subject: Re: [OT] sed question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: freebsd@celestial.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Mar 2004 00:46:25 -0000 On Sun, Mar 14, 2004, Warren Block wrote: >On Sun, 14 Mar 2004, Steven N. Fettig wrote: > >> I can't figure out what the newline character is... I've tried \n \r &\, >> etc. with no avail. I run the following: >> >> sed 's/[ ]/\n/g' my_test_text_document.txt > >>From the sed man page: > >"2. The escape sequence \n matches a newline character embedded in > the pattern space. You can't, however, use a literal newline > character in an address or in the substitute command." > >I think this is a BSD thing, and sed on other systems does handle \n and >other literals in substitutions. It's annoying enough that I just use >Perl instead. I thought it was the other way around, that the gnu version of sed accepts the standard ``C'' escape sequences, but the FreeBSD version doesn't. I always use the gnu tools configured with the program-prefix='g' option, and referenced as ``gsed'' rather than depending the the native ``sed'' doing what I expect. Bill -- INTERNET: bill@Celestial.COM Bill Campbell; Celestial Software LLC UUCP: camco!bill PO Box 820; 6641 E. Mercer Way FAX: (206) 232-9186 Mercer Island, WA 98040-0820; (206) 236-1676 URL: http://www.celestial.com/ ``Never chastise a Windows user...just smile at them kindly as you would a disadvantaged child.'' WBM