ms, sanesecurity, clamd and freebsd

Mikael Syska mikael at syska.dk
Mon Oct 8 21:23:03 IST 2007


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



More information about the MailScanner mailing list