User`s guide
4-162
Guide to Printers and Printing
Filters
Virtual printer definitions in both Version 3.2.5 and AIX Version 4. contain predefined and
open (undefined) filter attributes; AIX Version 4. offers a richer set of filter attributes. For
instance, an AIX Version 4. ASCII queue on an IBM 4029 LaserPrinter offers the following
filter attributes:
• f1, f2, f3, f4, and f5 – open, user–defined filters
• fb – bidi filter for Hebrew/Arabic.
• fc – cifplot filter
• fd – TeX (DVI) filter
• ff – FORTRAN filter
• fg – plot filter
• fl – passthru filter
• fn – ditroff filter
• fp – pr filter
• fv Raster image filter
A similar Version 3.2.5 virtual printer definition offers the following filter attributes:
• fc, fd, ff, fg, fl, fn ,ft, fv – open, user–defined filters
• fp – pr filter
Filters are the first programs in the input data stream processing pipeline set up by piobe
that have an opportunity to selectively manipulate the data stream. A particular filter can be
selected from the command line on a per job basis, or permanently selected by modifying
the virtual printer definition.
The qprt command uses the –f flag to select a particular filter on a per–job basis. The
argument to the –f flag is the second letter of the two letters that name the filter attribute in
the virtual printer definition. For instance, to select the pr filter for a job on an ASCII queue
named asc on an IBM 4029 LaserPrinter, you could issue this command:
qprt –Pasc –fp /etc/motd
The filter attribute that selects the pr filter is named fp, so the argument to the –f flag is just
p, the second letter.
To permanently select the pr filter, use lsvirprt to edit the virtual printer definition and set
the value of the _f attribute to p. The _f attribute selects a filter that will be used to
pre–process any job submitted to the queue associated with this virtual printer definition.
Since lp, lpr, and qprt are all just front ends to the enq command, the true entry point to the
spooler, you would suppose that enq must support the –f flag. If you issue the enq
command with the –f flag, however, you will receive an error message; enq does not
support the –f flag. This is a situation where the previously described technique of mounting
/bin/echo over /bin/enq proves useful.
The root user can issue these commands from a shell prompt:
1. mount /bin/echo /bin/enq
2. qprt –Pasc –fp /etc/motd
3. umount /bin/enq
After the second command is issued, the following appears in the display element defined
by your TERM environment variable:
–P asc –o –f –o p /etc/motd