How about getting rid of the backspaces before you print the script files?
O'Reilly's Unix Power Tools, second edition, section 51.06 "Cleaning script files" Search Google for "script.tidy" and you will find it. Phillip Griffith (803) 952-8776 Information Technology Department Westinghouse Savannah River Company Lisa Weihl <[EMAIL PROTECTED]> Sent by: [EMAIL PROTECTED] 11/27/2001 08:21 PM Please respond to lprng To: [EMAIL PROTECTED] cc: Subject: LPRng: mostly ascii file getting typed as data I have a unique situation in which professors are dealing with files that students create via a shell script called photo. The photo script basically runs the Unix script command and saves the output to a file. Usually the things they do while running the photo script are to cat out their programs, issue some commands and execute their programs. If they make mistakes while typing and backspace those characters end up as non-printable in the photo log file. These files reside on another Unix system outside my dept. and when they are printed (currently from DEC Unix) they are simply handed over to my lpd. I'm using LPRng 3.7.4 and ifhp 3.4.4 The problem is that even though the majority of the file is ascii text the GNU file command in my ifhp filter is declaring these files as type data because of those non-printable characters. The file type data is not defined and so ifhp quits without printing. As a quick fix I tried just to tell ifhp to run it through a2ps anyway even if the type was data. In that case a2ps is complaining that the file is binary and won't convert it. The strange thing (or maybe not strange to those of you who understand this better than I) is that running a2ps -Pmyprinter --non-printable-format=space thenastyfile on the original system lets the file come through just fine. Below for reference here's the relevant section of my ifhp.conf file. Nothing fancy. Anyone have any ideas of anything I can do to handle this situation? To be honest I got LPRng + ifhp up and running and haven't worked with it much since then. TIA for any help. # set forceconversion to force the file(1) utility to be used default_language=text forceconversion@ ## UNIX File utility path file_util_path= /usr/local/bin/file - ## Patterns and Converters # example conversion program file_output_match = [ *postscript* ps \%s{ps_converter} *pcl* pcl \%s{pcl_converter} *pjl* pjl \%s{pjl_converter} *pdf* ps \%s{pdf_converter} *jpeg* ps \%s{a2ps_converter} *gif* ps \%s{a2ps_converter} *printer*job*language* pjl # *text* pcl \%s{text_converter} *text* ps \%s{a2ps_converter} *data* ps \%s{a2ps_converter} *gzip_compressed* filter \%s{gzip_decompress} ] # gs_device=epsonc # gs_options=-r240x72 # gs_converter= /usr/local/bin/gs -dSAFER -dBATCH -q -sOutputfile=- -sDEVICE=\% s{device} # \%s{gs_options} - # # gs_converter= /usr/local/bin/gs -q -dSAFER -dBATCH -sOutputFile=- -sPAPERSIZE=\ %L{papersize} -sDEVICE=\%s{gs_device} \%s{gs_options} - gs_unidriver= /usr/local/bin/gs -q -dSAFER -dBATCH -sOutputFile=- -sPAPERSIZE=\ %L{papersize} @\%s{gs_device} \%s{gs_options} - #a2ps_options= -q -B -1 -M \%M{papersize} --borders=no -o- a2ps_options= -q --non-printable-format=space '--header=Printed by: \%s{n}' '-- stdin=\%s{N}' --font-size=9 --columns=1 --portrait -M \%M{papersize} --borders= yes -o- a2ps_converter= /usr/local/bin/a2ps \%s{a2ps_options} gzip_decompress = /usr/local/bin/gzip -c -d pdf_converter = /usr/local/libexec/filters/acroread-wrapper.sh ********************************************************************************** Lisa Weihl, System Administrator E-mail: [EMAIL PROTECTED] Department of Computer Science Office: Hayes 225 Bowling Green State University Phone: (419) 372-0116 Bowling Green, Ohio 43403-0214 Fax: (419) 372-8061 ----------------------------------------------------------------------------- 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. ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- 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. -----------------------------------------------------------------------------