From owner-freebsd-questions Wed Dec 30 03:06:14 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id DAA01583 for freebsd-questions-outgoing; Wed, 30 Dec 1998 03:06:14 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from alice.gba.oz.au (gba-254.tmx.com.au [203.9.155.254]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id DAA01578 for ; Wed, 30 Dec 1998 03:06:10 -0800 (PST) (envelope-from gjb@acm.org) Received: (qmail 7078 invoked by uid 1001); 30 Dec 1998 10:56:16 -0000 Message-ID: <19981230105616.7077.qmail@alice.gba.oz.au> X-Posted-By: GBA-Post 1.03 20-Sep-1998 X-PGP-Fingerprint: 5A91 6942 8CEA 9DAB B95B C249 1CE1 493B 2B5A CE30 Date: Wed, 30 Dec 1998 20:56:15 +1000 From: Greg Black To: Charles Henrich Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Sed sillyness (stupid question?) References: <19981229175952.44230@orbit.flnet.com> In-reply-to: <19981229175952.44230@orbit.flnet.com> of Tue, 29 Dec 1998 17:59:52 PST Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: But you didn't do what the man page you quoted said: > 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 you need is: sed 's,test,te\ st,' In other words, you need a real backslash character followed by a real newline character -- not some code for it like "\n". And, for the people who posted the wrong answers that I've seen so far, please take the few seconds to check them first ... -- Greg Black To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message