6.0

48
Creating Triggers
2
5. Set the permissions on the input filter file so that it can be executed from root. Use the chmod
command as follows, replacing mailing.scr with the name of your input filter file:
chmod 755 /var/spool/lpd/mailing.scr
6. Edit the printcap file to add the input filter to the queue definition. Your entry should now look like this:
mailing:\
:sd=/var/spool/lpd/mailing:\
:mx#0:\
:sh:\
:lp=/dev/lp1:\
:if=/var/spool/lpd/mailing.scr:
It is important to add a backslash to a line before adding a new line, and to add a colon at the end of
each new line.
7. Save the changes and exit the printcap file.
You have created your trigger. To print data on the MAILING document, use the queue "mailing". For
example:
lpr -Pmailing data.txt
To create a printcap entry by hand:
1. Open the /etc/printcap file with a text editor. For example, you might open it with the vi text editor by
issuing the command
vi /etc/printcap
2. Enter the following at the end of the /etc/printcap file. Change the queue name and spool directory to
reflect your installation. This printcap entry is for a text-only printer on device lp1 named mailing, that
uses the spool directory /var/spool/lpd/mailing.
mailing:\
:sd=/var/spool/lpd/mailing:\
:mx#0:\
:sh:\
:lp=/dev/lp1: