ms, sanesecurity, clamd and freebsd

Rick Cooper rcooper at dwford.com
Mon Oct 8 23:23:57 IST 2007


Or you can just remove the offending /i. It's not valid in MAC or FreeBSD
and I removed it from the script I was maintaining in July.

Clam_Db_Dir=`${clamscan} --debug $tmp_dir/test.file 2>&1 | grep -m 1 -i -E \
'loading databases from.*clamav\/?$'| sed "s/.*oading databases from //"`

Works fine and it's os dependant

Rick 

 > -----Original Message-----
 > From: mailscanner-bounces at lists.mailscanner.info 
 > [mailto:mailscanner-bounces at lists.mailscanner.info] On 
 > Behalf Of Mikael Syska
 > Sent: Monday, October 08, 2007 4:23 PM
 > To: MailScanner discussion
 > Subject: Re: ms, sanesecurity, clamd and freebsd
 > 
 > Hi,
 > 
 > Thanks for the reply.
 > 
 > René Berber wrote:
 > > Mikael Syska wrote:
 > >
 > > [snip]
 > >   
 > >> I get the following:
 > >> sed: 1: "s/\/$//; s/^.*loading d ...": bad flag in 
 > substitute command: 'i'
 > >>
 > >> And then I'm lost ... just wandered if some one here 
 > maybe could tell me
 > >> if the "sed" command is different on FreeBSD or maybe 
 > someone using it
 > >> on freebsd with no problems .... ?
 > >>     
 > >
 > > Yes sed is different, GNU's sed does accept the -i option, 
 > other older versions
 > > of sed (which I have in Solaris) don't.
 > >
 > > There are at least 2 options:
 > >
 > > - Install GNU sed;
 > > - Change the script from sed to perl.  perl also has a -i 
 > option so the
 > > equivalent of what I see above would be:
 > >
 > > perl -pi -e "s/\/$//; s/^.*loading d ..."
 > >   
 > The whole line would be this then:
 > clam_db_dir=`"$clamscan" --debug "$test_file" 2>&1 | \
 >                 sed -ne 's/\/$//; s/^.*loading databases from 
 > \(.*\)$/\1/ip' | head -1`
 > 
 > If you could translate that, I would be very happy. Maybe 
 > other freebsd 
 > users have the same problem.
 > 
 > I will then mail the author of the script, maybe he can 
 > check if its the 
 > GNU version that is being used ... and then use perl to fetch it.
 > 
 > best regards
 > Mikael Syska
 > 
 > -- 
 > MailScanner mailing list
 > mailscanner at lists.mailscanner.info
 > http://lists.mailscanner.info/mailman/listinfo/mailscanner
 > 
 > Before posting, read http://wiki.mailscanner.info/posting
 > 
 > Support MailScanner development - buy the book off the website! 
 > 
 > --
 > This message has been scanned for viruses and
 > dangerous content by MailScanner, and is
 > believed to be clean.
 > 
 > 
 > 


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.




More information about the MailScanner mailing list