sed command error

Issues related to applications and software problems
Post Reply
sms_2016
Posts: 8
Joined: 2016/10/13 11:25:19

sed command error

Post by sms_2016 » 2016/10/19 09:11:07

Hi All,

Now i am trying to install ClamAV on my centos 7 server.while configuring i have given the below command as per tutorial.

sed -i ‘/^Example/d’ /etc/clamd.d/clamd.conf

i got the following error

sed -i ‘/^Example/d’ /etc/clamd.d/clamd.conf

Anybody can help me to fix the issue.

Thanks in Advance

giulix63
Posts: 1305
Joined: 2014/05/14 10:06:37
Location: UK

Re: sed command error

Post by giulix63 » 2016/10/19 09:22:21

You pasted the command twice. The two most likely issues: either there are unknown character in that command, or the file is not found/not what you expect it to be. For example:

Code: Select all

# cat clamd.conf 
Line one
Example: pioipl;ks
Line three
# sed -i "/^Example/d" clamd.conf
# cat clamd.conf 
Line one
Line three
should yield the desired result...
Root is evil: Do not use root (sudo) to run any of the commands specified in my posts unless explicitly indicated. Please, provide the necessary amount of context to understand your problem/question.

sms_2016
Posts: 8
Joined: 2016/10/13 11:25:19

Re: sed command error

Post by sms_2016 » 2016/10/19 09:38:25

Thanks for your reply

Sorry for the mistake

The error is sed: -e expression #1, char 1: unknown command: `�

Thanks in Advance

giulix63
Posts: 1305
Joined: 2014/05/14 10:06:37
Location: UK

Re: sed command error

Post by giulix63 » 2016/10/19 09:42:45

Yes, use single quote (') or double ones (") to enclose sed commands, nothing else.
Root is evil: Do not use root (sudo) to run any of the commands specified in my posts unless explicitly indicated. Please, provide the necessary amount of context to understand your problem/question.

Post Reply