#!/bin/sh # # As of version 1.011/Linux, NOD32 spits out DOS-screen-oriented garbage # even if standard output is not connected to a tty. The easiest way to # filter it out is: # # exec $NOD32_BIN_DIR/nod32 -log- -basedir=$NOD32_VDF_DIR "$@" | \ # tr '\r' '\n' | tr -dc '[:print:]\n' # # which, however, ALWAYS EXITS SUCCESSFULLY because of the terminating 'tr'. # Since the logfile is clean, we can attempt to use that and discard # output altogether. # # A cumbersome solution using tempfiles: # # TMPFILE=`mktemp` # $NOD32_BIN_DIR/nod32 -basedir=$NOD32_VDF_DIR -log=$TMPFILE "$@" >/dev/null # RC=$? # cat $TMPFILE # exit $RC # # If your system has /dev/fd/* or /dev/stderr, then the next approach # could work, since NOD32 appears not to use the real standard error output # -- I have only tested it with Linux, though. # NOD32_BIN_DIR=/usr/local/nod32 # where 'nod32' executable is NOD32_VDF_DIR=/var/local/nod32 # where *.000 virus definition files are # catch help invocation (won't work if stdout is redirected) if [ "x$*" = "x-?" -o "x$*" = "-h" -o "x$*" = "x-help" ]; then exec $NOD32_BIN_DIR/nod32 -? fi # let's rock exec $NOD32_BIN_DIR/nod32 -basedir=$NOD32_VDF_DIR -log=/dev/stderr "$@" \ 2>&1 >/dev/null __END__