Skip to content
Advertisement

CentOS inserting new line of text after another using sed not working

I’m trying to insert a line of text which is;

JavaScript

On the next line after the words;

JavaScript

in my /etc/nginx/nginx.conf using the following command

JavaScript

But each time i run it, it just returns

JavaScript

Im not very good with this sort of stuff so i was hoping someone could help me out.

Cheers,

Advertisement

Answer

Remove the second single-quote. It is superfluous:

JavaScript

Also, Because . matches any character and you probably want it to match only a period, escape it like this:

JavaScript

Or this:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement