G
G
ganzales2019-11-11 15:03:13
linux
ganzales, 2019-11-11 15:03:13

Search and replace via sed with line break?

We have

cat test
one
two
three
four

I do this and
sed s/two\nthree// test
sed s/two.*three// test
in both cases I get:
one
two
three
four

How to get the?
one
four

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
vreitech, 2019-11-11
@ganzales

sed -rz 's/two\nthree\n//' test

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question