Problem with sed to insert a new line
infofarmer at FreeBSD.org
Thu Jun 28 10:36:26 UTC 2007
On 6/28/07, Olivier Regnier <oregnier at oregnier.net> wrote:
> Hi everyone,
> I have a file called "test" with the following lines:
> With sed, i want to insert the "c" letter after "b" letter. Logically
> simple, but not for me.
> Here is my command : # sed -i.old -e "4i\c"
> I have this message : sed: 1: "4i\c": extra characters after \ at the
> end of i command
AFAIK, with our sed you can only do that with multiline
% sed -i.old -e "4i\\<press enter>
The backslash is doubled, because shells interpret
backslash-newline as a space. With GNU sed it's
More information about the freebsd-questions