Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Dec 1998 21:05:26 -0500 (EST)
From:      Thomas David Rivers <rivers@dignus.com>
To:        freebsd-questions@FreeBSD.ORG, henrich@flnet.com
Subject:   Re: Sed sillyness (stupid question?)
Message-ID:  <199812300205.VAA03859@lakes.dignus.com>
In-Reply-To: <19981229175952.44230@orbit.flnet.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199812300205.VAA03859>