fork(1) download
  1. sed '/anchor-start/,/anchor-end/{/anchor-start/{h;d};H;/anchor-end/{x;/wrapping-start/b;s/\n.*\n/\nwrapping-start&wrapping-end\n/p};d}'
Success #stdin #stdout 0.02s 5308KB
stdin
This
is
a
test. 1
anchor-start
text to wrap will is in here
anchor-end

This
is
a
test. 2
anchor-start
wrapping-start
text to wrap will is in here
wrapping-end
anchor-end

This
is
a
test. 3
anchor-start
text to wrap will is in here
anchor-end
stdout
This
is
a
test. 1
anchor-start
wrapping-start
text to wrap will is in here
wrapping-end
anchor-end

This
is
a
test. 2
anchor-start
wrapping-start
text to wrap will is in here
wrapping-end
anchor-end

This
is
a
test. 3
anchor-start
wrapping-start
text to wrap will is in here
wrapping-end
anchor-end