From owner-freebsd-questions Tue Dec 29 18:04:50 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id SAA14674 for freebsd-questions-outgoing; Tue, 29 Dec 1998 18:04:50 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from smtp1.vnet.net (smtp1.vnet.net [166.82.1.31]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id SAA14667 for ; Tue, 29 Dec 1998 18:04:48 -0800 (PST) (envelope-from rivers@dignus.com) Received: from dignus.com (ponds.vnet.net [166.82.177.48]) by smtp1.vnet.net (8.9.1a/8.9.1) with ESMTP id VAA26040; Tue, 29 Dec 1998 21:04:47 -0500 (EST) Received: from lakes.dignus.com (lakes.dignus.com [10.0.0.3]) by dignus.com (8.9.1/8.8.5) with ESMTP id VAA16100; Tue, 29 Dec 1998 21:47:44 -0500 (EST) Received: (from rivers@localhost) by lakes.dignus.com (8.9.1/8.6.9) id VAA03859; Tue, 29 Dec 1998 21:05:26 -0500 (EST) Date: Tue, 29 Dec 1998 21:05:26 -0500 (EST) From: Thomas David Rivers Message-Id: <199812300205.VAA03859@lakes.dignus.com> To: freebsd-questions@FreeBSD.ORG, henrich@flnet.com Subject: Re: Sed sillyness (stupid question?) In-Reply-To: <19981229175952.44230@orbit.flnet.com> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > Why doesnt this work: > > sed 's,test,te\nst,' > > That is when test is found how come sed doesnt actually print the newline > character? The man page claims it should: > > A line can be split by substituting a newline character into it. > To specify a newline character in the replacement string, precede > it with a backslash. > > > What obviousness am I missing here, anyone? > > Thanks! I bet you see the actual \n - don't you? That's because your \n isn't a new-line, it's the backslash character followed by a letter n. You can verify this with a quick check using echo. Try this: sed "s,test,te st," and - nope ; that's not a mail formatting problem... it's a quoted string with a new-line in the middle. - Dave Rivers - To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message