: # @(#) bds 25.2 95/03/27 # #! basic dumb netcat model file printer=`basename $0` request_id=$1 user_name=$2 title=$3 copies=$4 options=$5 shift 5 files="$*" # Look for HOST and Port address # Note that names and ports are in the file /etc/printers # in the format: # printer_name:host_name:port_number PRTSETUP=`grep "^$printer:" /etc/printers` if [ $? = 0 ] then PRTHOST=`echo $PRTSETUP|awk -F: '{ print $2 }'` PRTPORT=`echo $PRTSETUP|awk -F: '{ print $3 }'` else exit 1 fi # stty ixon ixoff ixany onlcr opost 0<&1 # send the file(s) to the standard out $copies times while [ "$copies" -gt 0 ] do for file in $files do cat ${file} 2>&1 echo "\033E\c" done copies=`expr $copies - 1` done | /usr/lib/lponlcr | /usr/local/bin/netcat -h $PRTHOST -p $PRTPORT exit 0