Specifications
6-11
System V Printer Configuration
When the interface script is invoked:
• Standard input comes from /dev/null.
• Standard output is directed to the printer port.
• Standard error output is directed to a file that will be displayed to the user who submitted
the print request.
The print service passes additional printer configuration information to the interface script as
the following shell variables:
TERM= printer–type Specifies the printer type. The value is used as a key for
obtaining printer capability information from the extended
terminfo database.
FILTER= pipeline Specifies the filter to use to send the request content to the
printer; the filter is given control of the printer.
CHARSET= character–set Specifies the character set to use when printing the content
of a print request. The standard interface script extracts the
control sequences needed to select the character set from
the terminfo database.
Creating Printer Interface Scripts
If you have a printer that is not supported by adding an entry to the terminfo database, or if
your printing needs are not supported by the standard or other interface scripts provided in
the /etc/lp/model file, you can create your own printer interface script.
To create a customized interface script, do the following:
1. Modify the standard interface script (or one of the other scripts in /etc/lp/model). For
example:
cd /etc/lp/model
cp standard okidatanew
2. Make sure that the custom interface script sets the proper stty modes (terminal
characteristics such as baud rate or output options). Look for the section that begins with
this line:
## Initialize the printer port
Modify the code in the standard interface script. It sets both the default modes and the
adjusted modes given by the print service or the user with a line similar to the following:
stty mode options 0<&1
This command line takes the standard input for the stty command from the printer port.
For example, the following stty command example sets the baud rate to 1200bps and
sets some of the option modes:
stty –parenb –parodd 1200 cs8 cread clocal ixon 0<&1
3. Set the hardware–flow control printer–port characteristic. The standard interface script
does not set hardware flow control; it is set according to your computer hardware. The
code for the standard interface script suggests where to set this and other printer port
characteristics. Look for the section that begins with this line:
# Here you may want to add other port initialization code.
4. Because different printers have different numbers of columns, make sure the header and
trailer for your interface script correspond to your printer. The standard interface script
prints a banner that fits on an 80–column page (except for the user’s title, which may be
longer). Look for the section in the code for the standard interface script that begins with
this line: