OT: skinflinter printing

Jean-Pierre A. Radley appl at jpr.com
Wed Apr 13 13:54:26 PDT 2005


Mailing an invoice or other document consumes postage stamps.
Faxing also costs a few pennies.

For those of my correspondents who are 'net-connected, I eschew such
picayune disbursements of pennies: using uucp over tcp/ip, I print the
output on a printer near the desk of the person who should receive it.

Here's my Unix printer interface script:

   :
   #	@(#) JPRadley  07Apr05
   #	@(#) basic dumb uux model file
   
   printer=`basename $0`
   copies=$4
   shift 5
   files="$*"
   
   # Look for uucp HOST and its PRINTER in the file /usr/local/etc/printers
   #  in the format:
   #    local_printer_name:uucp_host_name:uucp_host_printer_name
   #
   # That HOSTS's UUCP Permissions' COMMANDS must include lp, not just
   #  the default rmail and rnews.
   
   LOCATION=`grep "^$printer:" /usr/local/etc/printers`
   if [ $? = 0 ]
   then
	eval `echo $LOCATION | awk -F: '{print "HOST=" $2 " PRINTER=" $3} '`
   else
	exit 55
   fi
   
   # send the file(s) to standard output $copies times
   while [ "$copies" -gt 0 ]
   do
	for file in $files
	do
	   cat  ${file} 2>&1
	done
	copies=`expr $copies - 1`
   done |
   /usr/lib/lponlcr |
   /usr/bin/uux - $HOST!lp -d $PRINTER
   
   exit 0

-- 
JP


More information about the Filepro-list mailing list