Hello again,

Something didn't seem quite right so I've been experimenting with this.

On Sun, 26 Aug 2012, G.W. Haywood wrote:

    1. Is this a correct invocation to scan the filesystem, excluding
       the system filesystems /proc, /sys, and /dev, also
       excluding /media?

No.  Your patterns will probably match nothing.  The caret ('^') is
not required unless you have a directory called '^' which would be
willful to say the least.  The pattern is *not* a regular expression
(or 'regex'), it is only a pattern which will be matched against paths
found by scanning the directory structure.

What I wrote there is rubbish.  Please ignore it and accept my apologies.

The man page is clear that PATT is a pattern.  It is not terribly
clear on what sort of a pattern, so experiment.  It definitely does
not say that it's a regular expression. ...

But in fact it appears that it is a regular expression of some sort.
At least it behaved that way in my tests today:

laptop:~$ >>> pwd
/home/ged
laptop:~$ >>> ls -l Temp* temp*
temp:
total 24
...

Temp1:
total 0

Temp2:
total 0

Temp3:
total 0

laptop:~$ >>> clamscan -r --include-dir='^/h.*Temp' /home/ged/[Tt]emp*
...
/home/ged/temp: Excluded
...
Scanned directories: 3
...

So the caret does appear to anchor the string at the beginning, and .*
does seem to match an indeterminate string of characters.  I've quoted
the expression in the include-dir string to avoid shell expansion, I'm
not sure it's necessary but more experiment will answer that question.
I haven't tested the numerous other possible constructs available in
regular expressions.  There will be easier ways than experimentation
to find out what sort of expressions are permitted.  I don't know how
to type the emoticon for a sheepish grin.

--

73,
Ged.
_______________________________________________
Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net
http://www.clamav.net/support/ml

Reply via email to