On Wed, 2004-08-11 at 10:51, Damian Menscher wrote:
> On Wed, 11 Aug 2004, Silly Billy wrote:
> 
> > while executing this command to configure Clamav ...
> >
> > perl -pi -e "s/^LocalSocket /tmp/clamd/LocalSocket
> > /var/run/clamav/clamd/g" /etc/clamav.conf
> >
> > an error appear as mentioned below ...
> >
> > [EMAIL PROTECTED] test]# perl -pi -e "s/^LocalSocket
> > /tmp/clamd/LocalSocket /var/run/c
> > lamav/clamd/g" /etc/clamav.conf
> > Bareword found where operator expected at -e line 1,
> > near "s/^LocalSocket /tmp/c
> > lamd"
> > syntax error at -e line 1, near "s/^LocalSocket
> > /tmp/clamd"
> > Execution of -e aborted due to compilation errors
> >
> > Could anyone help me to sort out this error ??
> 
> You're doing a search-and-replace.  The way that works is it takes the
> first character after the / and uses it as the delimiter for what to
> search for vs what to replace it with.  Since you have lots of /es in
> your pathnames, you're totally confusing it.  Try the command:
> 
> perl -pi -e "s!^LocalSocket /tmp/clamd!LocalSocket /var/run/clamav/clamd!" 
> /etc/clamav.conf
> 
> Here I'm just using ! instead of / as the delimiter.
> 
> As a side note, when trying to be completely general, I often use ^G as
> my delimiter.  Never seen a config file with one of those!  ;)

Using a ! as a delimiter can cause problems unless your expression is
enclosed in single quotes. Keep in mind the shell will try and
interpret stuff inside double quotes. For instance, if I try the
above (at least with csh) I get:
        LocalSocket: Event not found.

Best to always use single quotes unless you are doing variable
substitution. This applies to sed, as well.

        -Bill



-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
Clamav-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/clamav-users

Reply via email to