How to setup filters with CUSP printing

Michael Sweet mike at easysw.com
Tue Jul 18 07:13:44 PDT 2006


danesh wrote:
> I wish to resolve a problem whereby the output of my ASCII file is printing as step.
> 
> I wish to create a filter using shell script that will allow me to put a carriage return at the end of each line.
> How would I setup a filter on RedHat Linux AS 4.

The following simple filter will do the trick:

     "textonly.sh":

     #!/bin/sh
     #
     # Interface script for printing text to any printer.
     #
     # This is a standard System V interface script; the arguments are
     # as follows:
     #
     #     printer job user title copies options filename
     #

     # Parse options...
     copies=$4

     # Send the print file...
     copy=1
     while test $copy -le $copies; do
             awk '{print $0 "\r"}' < $6
             echo "\014\c"

             copy=`expr $copy + 1`
     done

     # Done!
     exit 0

To use it, run the lpadmin command with the "-i" option:

     lpadmin -p printername -E -v device-uri -i textonly.sh

-- 
______________________________________________________________________
Michael Sweet, Easy Software Products           mike at easysw dot com
Internet Printing and Document Software          http://www.easysw.com




More information about the cups mailing list