$ cat file
BEGIN
hello
world
how
are
you
END
$ sed -e '/BEGIN/,/END/cBEGIN
fine, thanks
END' file
BEGIN
fine, thanks
END
/BEGIN/,/END/
selects a range of text that starts with BEGIN
and ends with END
. Then c
command is used to replace the selected range with BEGIN
fine, thanks
END
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…