Im running against the wall in this command..
I want to remove the line:
include "/etc/nginx/software.conf";
from the file called website
.
I've tried:
sed -ri '/include \"/etc\/nginx\/wesbite.conf\"\;/d' website
A simple sed
command works fine.. but all this special letters confuses me.
Any suggestions please?
Thanks alot.
I need a command that remove: include "/etc/nginx/software.conf";
from the file "website"
– Morten Jørgensen Oct 05 '20 at 09:20sed
command works fine" seemed to indicate your attempt works. Try it without the backslashes before the double-quotes and the semicolon. Escaping a double-quote is not necessary inside single quotes, and may instead be mis-interpreted.sed '/include "\/etc\/nginx\/software.conf";/d' website
should work. Also, there is a typo in the command you presented (wesbite.conf
as opposed tosoftware.conf
). If that is also in your original command, that may be the problem. – AdminBee Oct 05 '20 at 09:23Sadly it doesnt work. I dont receive any errors.. But the text is still in the file.
No the typo isnt in the input :D /Morten
– Morten Jørgensen Oct 05 '20 at 09:28sed '/include "/etc/nginx/software.conf";/d' website
nano website include "/etc/nginx/software.conf";
– Morten Jørgensen Oct 05 '20 at 09:42'/include \"/etc\/nginx\/wesbite.conf\"\;/d'
) matched the command later shown in a comment ('/include "\/etc\/nginx\/software.conf";/d'
). The former doesn't work for the sample input, the latter does (note especially the escaping of the first"
and/
). – fra-san Oct 10 '20 at 14:18