Here is the text-only filter I'm trying to implement on my line-printer:

-- textonly.sh
#!/bin/sh

type=`file -i -`;

while [ $# != 0 ];
do case "$1" in
 -L* ) username=`echo "$1" | sed s/..//` ;;
 -P* ) printer=`echo "$1" | sed s/..//` ;;
 esac;
 shift;
done

case "$type" in
       *text* ) break;;
       * ) echo "From: LPRng Printing Subsystem <[EMAIL PROTECTED]>\nSubject: Invalid 
print request to queue '$printer'\nA non-text print job was sent to the text-only 
printer, $printer, and therefore could not be printed. This print job was discarded. 
In he future, please send non-text jobs to your local laser or inkjet printer. If you 
need help, please see ACS Support Desk staff -- they may be reached by telephone at 
973/972.6789.\n\n--\nThis is an automated message -- replies will be discarded." | 
mail $username;
               exit 0;
               ;;
esac
exec /opt/LPRng/libexec/filters/lpf
--

If I cat something to it, it works as expected -- the file either is
printed on the screen, or the e-mail is sent out. But hey, once I start
using it on the actual queue:

Printer: lp@njmsa
lp
 :ab
 :af=acct
 :bp=/opt/LPRng/libexec/filters/lpbanner
 :cm=Newark Lab - C632 - HP LinePrinter 2563A
 :filter=/opt/LPRng/libexec/filters/textonly.sh
 :rm=ps1nwk
 :rp=pr1
 :sd=/var/spool/lpd/%P
lp:server:remote_support=R

...it's toast. Jobs say "ABORT" because of datafile size of 0
(incidentally, I can't get a banner page to actually print out of here
either). I've used textonly.sh as an :if entry, :filter entry, and even a
|...textonly.sh for both of those.

Someone offer some insight PLEASE? :)

---- _  _ _  _ ___  _  _  _
|Y#| |  | |\/| |  \ |\ |  |  | Ryan Novosielski - Jr. UNIX Systems Admin
|$&| |__| |  | |__/ | \| _|  | [EMAIL PROTECTED] - 973/972.0922 (2-0922)
\__/ Univ. of Med. and Dent. | IST/ACS - New Jersey Medical School - C630


-----------------------------------------------------------------------------
YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
The address you post from MUST be your subscription address

If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body.  For the impatient,
to subscribe to a list with name LIST,  send mail to [EMAIL PROTECTED]
with:                           | example:
subscribe LIST <mailaddr>       |  subscribe lprng-digest [EMAIL PROTECTED]
unsubscribe LIST <mailaddr>     |  unsubscribe lprng [EMAIL PROTECTED]

If you have major problems,  send email to [EMAIL PROTECTED] with the word
LPRNGLIST in the SUBJECT line.
-----------------------------------------------------------------------------

Reply via email to