#! /bin/sh
#
# file1.sh
#
# Example script to process one file using vfind via named pipes.
#
# See also: pipe1.sh
#
# Version: Tue May  7 21:09:50 EDT 2002
#
# Please check the CAUTION and CONFIGURATION sections below,
# and modify this script to suit your requirements before trying to use it.
# CyberSoft, Inc. is not responsible for any damage, be it physical or mental,
# caused or indirectly caused by this example script.
#
# Copyright (c) May 2002 by CyberSoft, Incorporated.
##
###

###
##
# CAUTION:
#
# This script uses the current directory, and pipes named "in1" and "out1".
#
##
###

###
##
# CONFIGURATION:
#
# path for shell commands
#
PATH="/usr/bin"
export PATH
#
##
###

# write file name to input pipe
#
echo "$@" >in1

# read vfind output
#
while read line
do
  n=`expr "$line" : "^##==>>>>"`
  if [ "$n" = "8" ]; then
    echo "$line"
  else
    n=`expr "$line" : "^##==> Number of possible virus infections"`
    if [ "$n" = "41" ]; then
      echo "$line"
      break
    fi
  fi
done <out1
