From owner-freebsd-questions@FreeBSD.ORG Sun Mar 14 17:35:24 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 6D94416A4CE for ; Sun, 14 Mar 2004 17:35:24 -0800 (PST) Received: from wonkity.com (wonkity.com [65.173.111.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id E004943D1F for ; Sun, 14 Mar 2004 17:35:23 -0800 (PST) (envelope-from wblock@wonkity.com) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.12.11/8.12.11) with ESMTP id i2F1ZM7N075741; Sun, 14 Mar 2004 18:35:23 -0700 (MST) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.12.11/8.12.11/Submit) with ESMTP id i2F1ZMGa075738; Sun, 14 Mar 2004 18:35:22 -0700 (MST) (envelope-from wblock@wonkity.com) Date: Sun, 14 Mar 2004 18:35:22 -0700 (MST) From: Warren Block To: Rob Ellis In-Reply-To: <20040315001834.GA9303@web.ca> Message-ID: <20040314181756.Q48867@wonkity.com> References: <4054DD10.5060504@stevenfettig.com> <20040314164347.X35552@wonkity.com> <20040315001834.GA9303@web.ca> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-questions@freebsd.org Subject: Re: [OT] sed question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Mar 2004 01:35:24 -0000 On Sun, 14 Mar 2004, Rob Ellis wrote: > This works with sed in /bin/sh and ksh: > > sed -e 's/ */\ > /g' my_test_text_document.txt > > I.e., escape an actual newline. I used to do that, or include an actual newline in a script, but it just seems wrong from maintainability and readability standpoints. It seems slightly better to get a newline in a shell variable and then use that. -Warren Block * Rapid City, South Dakota USA