Specifications

4-146
Guide to Printers and Printing
The value of the st definition is similar to the value of the sh definition.
Custom Header Pages
The root user can create custom header pages for users by modifying the definiton of the
sh attribute. Because the spooler processes have access to the environment of the user
that submitted the job to the spooler, the root user can modify the portion of the sh attribute
definition that specifies which header page template to process.
For example, the H.ascii in the above definition specifies which header page template
should be processed and printed. It can be replaced with a user environment variable of
your choice, such as $MYHEADER, as shown below.
%Ide INCLUDE: (Directory Containing Miscellaneous
Modules)
’/pioburst ’
%F[H] If ”–H] Argument” on Command Line, ”–# Argument”
–> OUTPUT
’ ’
%Idb INCLUDE: (Directory Containing Header and Trailer
Text Files)
’/ $MYHEADER | ’
%Ide INCLUDE: (Directory Containing Miscellaneous
Modules)
’/pioformat –@’
%Idd INCLUDE: (Directory Containing Digested Data Base
Files)
’/’
%Imm INCLUDE: (File Name Of (Digested) Data Base; Init.
By
”piodigest” (mt.md.mn.mq:mv))
’ –!’
%Idf INCLUDE: (Directory Containing Loadable Formatter
Routines)
’/piof5202 –L! –J! ’
%IsH INCLUDE: (FORMATTING FLAGS for header page)
’ –u’
%IuH INCLUDE: (Input PAPER TRAY for header page)
To enable the user susan to get custom header pages with this queue, the root user could
use the following procedure:
cp /usr/lib/lpd/pio/burst/H.ascii /usr/lib/lpd/pio/burst/H.susan
Edit H.susan to Susan’s taste in header pages.
Set the environment variable MYHEADER in Susan’s environment to H.susan. (For
example, in the Korn shell, use export MYHEADER=H.susan ).
When the user susan submits a job to this queue, the sh attribute’s reference to a header
page template will resolve to /usr/lib/lpd/pio/burst/H.susan, and the user susan
will receive a custom header page. The problem with this scenario is that the environment
variable MYHEADER must be defined for anyone that uses the queue associated with this
virtual printer, else the virtual printer cannot resolve the reference to
/usr/lib/lpd/pio/burst/$MYHEADER. An error will result if $MYHEADER is undefined;
the job might print, but the header page will be recyclable at best.
To avoid the problem of everyone that uses this queue having to have MYHEADER defined,
you can integrate some shell code into the sh attribute definition to examine the user
environment before the header page pipeline is created. One method for doing this is shown
below.