[Novalug] sed syntax question

Mark Smith mark at winksmith.com
Thu Mar 8 21:02:41 EST 2007


sed isn't that great to work with newlines.  if you must use it
with newlines use a backslash and an actual newline (not a \n):

echo 'helloworld' | sed '
	s/hello/hello\
/
'

a couple of weeks ago i wrote a xml beautifier in sh.  it's possible
it's ugly, and fun.

-- 
Mark Smith
mark at winksmith.com
mark at tux dot org
nova-instructor at tux dot org



More information about the Novalug mailing list