Problem with update_virus_scanners script on Solaris

Malcolm Ray M.Ray at ULCC.AC.UK
Mon Sep 29 16:01:39 IST 2003


> The very latest version of this code already contains this:
>
> # Solaris requires xpg4 not normal grep for "-e" option
> OS=`uname`
> if [ "$OS" = "SunOS" ]; then
>    GREP=/usr/xpg4/bin/grep
> else
>    GREP=grep
> fi
>
> cat ${SCANNERSCONF} | sed -e 's/#.*$//' | ${GREP} -e -wrapper | \
> while read NAME WRAPPER PACKAGEDIR
> do
>
> which should solve the problem for you.
>
> At 14:24 29/09/2003, you wrote:
> >Greetings -
> >
> >MailScanner 4.23-11 includes a revised version of the
> >bin/update_virus_scanners script.  This appears to extract out details of
> >the wrapper scripts from the etc/virus.scanners.conf file.
> >
> >Unfortunately on Solaris the code to do this doesn't work.  In particular
> >this section of code:
> >
> >    cat ${SCANNERSCONF} | sed -e 's/#.*$//' | fgrep -e -wrapper | \
> >    while read NAME WRAPPER PACKAGEDIR
> >    do
> >        ...
> >
> >assumes 'grep' can take a '-e' option (to, I suspect, signal the next item
> >is a pattern despite it beginning with a '-' character).
> >
> >The standard grep (/usr/bin/grep) on Solaris doesn't have such an option,
> >and so the script fails.
> >
> >Two possible solutions:
> >a) Change to use 'fgrep' instead of 'grep', or
> >b) Change to use '/usr/xpg4/bin/grep' instead
> >
> >Of the two I'd suggest (a) is likely to be more cross-platform friendly ...
> >unless of course you know differently?
> >
> >Cheers,
> >
> >Mike Brudenell

Another alternative:

cat ${SCANNERSCONF} | sed -e 's/#.*$//' | ${GREP} -- -wrapper | \

Most greps, including Solaris grep, understand '--' as marking the end of
the flags.



More information about the MailScanner mailing list