PATH="/bin:/usr/bin:/usr/lib:/u/bin" export PATH printer=`basename $0` request=$1 name=$2 title=$3 copies=$4 options=$5 # Look for HOST and Port address 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 HPSETUP="" echo $options|grep -q "compress">/dev/null if [ $? = 0 ] then HPSETUP="\033E\033(s0P\033(s16.66H\033(10U\033&l7.27C" else echo $options|grep -q "normal">/dev/null if [ $? = 0 ] then HPSETUP="\033E\033(s0P\033(s10H\033(10U\033&l7.27C" fi fi ( shift; shift; shift; shift; shift files="$*" i=1 while [ $i -le $copies ] do for file in $files do if [ "$HPSETUP" != "" ] then echo $HPSETUP\\c fi cat $file|lponlcr done i=`expr $i + 1` done )|netcat -h $PRTHOST -p $PRTPORT