Suppose I have this text:
BEGIN
hello
world
how
are
you
END
How to convert it to bellow text using sed command in linux:
BEGIN
fine, thanks
END
Suppose I have this text:
BEGIN
hello
world
how
are
you
END
How to convert it to bellow text using sed command in linux:
BEGIN
fine, thanks
END
/BEGIN/,/END/
selects a range of text that starts withBEGIN
and ends withEND
. Thenc\
command is used to replace the selected range withBEGIN\nfine, thanks\nEND
.