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!  ;)

Damian Menscher [doesn't know perl, but knows sed....]
-- 
-=#| Physics Grad Student & SysAdmin @ U Illinois Urbana-Champaign |#=-
-=#| 488 LLP, 1110 W. Green St, Urbana, IL 61801 Ofc:(217)333-0038 |#=-
-=#| 4602 Beckman, VMIL/MS, Imaging Technology Group:(217)244-3074 |#=-
-=#| <[EMAIL PROTECTED]> www.uiuc.edu/~menscher/ Fax:(217)333-9819 |#=-
-=#| The above opinions are not necessarily those of my employers. |#=-


-------------------------------------------------------
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