1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2 3<html> 4 <head> 5 <meta name="generator" content="HTML Tidy, see www.w3.org"> 6 <title>Sample Printcap Entry</title> 7 <meta name="GENERATOR" content= 8 "Modular DocBook HTML Stylesheet Version 1.7"> 9 <link rel="HOME" title=" LPRng Reference Manual" href= 10 "index.htm"> 11 <link rel="UP" title="Print Spooling Tutorial " href= 12 "tutorial.htm"> 13 <link rel="PREVIOUS" title="Print Spooling Tutorial " href= 14 "tutorial.htm"> 15 <link rel="NEXT" title="Setting Up the Tutorial Configuration" 16 href="tutorialconfig.htm"> 17 </head> 18 19 <body class="SECT1" bgcolor="#FFFFFF" text="#000000" link= 20 "#0000FF" vlink="#840084" alink="#0000FF"> 21 <div class="NAVHEADER"> 22 <table summary="Header navigation table" width="100%" border= 23 "0" cellpadding="0" cellspacing="0"> 24 <tr> 25 <th colspan="3" align="center">LPRng Reference Manual: 5 26 Sep 2003 (For LPRng-3.8.22)</th> 27 </tr> 28 29 <tr> 30 <td width="10%" align="left" valign="bottom"><a href= 31 "tutorial.htm" accesskey="P">Prev</a></td> 32 33 <td width="80%" align="center" valign="bottom">Chapter 4. 34 Print Spooling Tutorial</td> 35 36 <td width="10%" align="right" valign="bottom"><a href= 37 "tutorialconfig.htm" accesskey="N">Next</a></td> 38 </tr> 39 </table> 40 <hr align="LEFT" width="100%"> 41 </div> 42 43 <div class="SECT1"> 44 <h1 class="SECT1"><a name="SAMPLEPRINTCAP">4.2. Sample 45 Printcap Entry</a></h1> 46 47 <p>As described in the <a href="tutorial.htm#OVERVIEW">Print 48 Spooling Overview</a>, the information in the <tt class= 49 "FILENAME">printcap</tt> database is used control printing 50 operations. While there is no RFC specifying its format or 51 content, there is a strong <span class="emphasis"><i class= 52 "EMPHASIS">de facto</i></span> standard for its format. For a 53 complete description of the <tt class= 54 "FILENAME">printcap</tt> database see <a href= 55 "printcapref.htm">Printcap Database</a>. For a list of all of 56 the <tt class="FILENAME">printcap</tt> and configuration 57 options see <a href="optionindex.htm">Index To All The 58 Configuration and Printcap Options</a>.</p> 59 60 <p>Here is a sample printcap suitable for use by the <b 61 class="APPLICATION">LPRng</b> clients:</p> 62 63 <div class="INFORMALEXAMPLE"> 64 <a name="AEN1703"></a> 65<pre class="SCREEN"> 66 LPRng use :lp for destination (device and spool queue) 67 lp:lp=lp@h4.private 68 lpreal:lp=/dev/lp0 69 70 Vintage BSD uses :rp:rm for spooler queue and :lp for device 71 lp:rp=lp:rm=h4.private 72 lpdev:lp=/dev/lp0 73</pre> 74 </div> 75 <br> 76 <br> 77 78 <p>The <var class="LITERAL">:lp=lp@h4.private</var> printcap 79 entry tells the <span class="emphasis"><i class= 80 "EMPHASIS">client</i></span> programs that jobs for the <b 81 class="APPLICATION">lp</b> printer or print queue are sent to 82 the <b class="APPLICATION">lp</b> print queue queue on host 83 <tt class="FILENAME">h4.private</tt>. This can also be 84 specified using the The <span class="emphasis"><i class= 85 "EMPHASIS">legacy</i></span> BSD <var class= 86 "LITERAL">:rp</var> and <var class="LITERAL">:rm</var>. The 87 <var class="LITERAL">:rp=</var><span class="emphasis"><i 88 class="EMPHASIS">queue</i></span> option specifies the <span 89 class="emphasis"><i class="EMPHASIS">print queue</i></span> 90 <var class="LITERAL">:rm=</var><span class="emphasis"><i 91 class="EMPHASIS">host</i></span> option specifies the host. 92 When both <var class="LITERAL">lp</var> and <var class= 93 "LITERAL">:rp:rm</var> are present the <var class= 94 "LITERAL">:lp</var> option has precedence.</p> 95 96 <p>On the printserver the following is a sample printcap 97 entry suitable for the <b class="APPLICATION">lpd</b> 98 server:</p> 99 100 <div class="INFORMALEXAMPLE"> 101 <a name="AEN1724"></a> 102<pre class="SCREEN"> 103 lp: 104 :lp=/dev/lp0 105 :sd=/var/spool/lpd/%P 106 :filter=/usr/local/libexec/filters/ifhp 107</pre> 108 </div> 109 <br> 110 <br> 111 112 <p>The <var class="LITERAL">:sd=</var><span class= 113 "emphasis"><i class="EMPHASIS">directory</i></span> option 114 (spool queue directory) specifies the directory where print 115 jobs will be placed. The <var class="LITERAL">%P</var> will 116 be replaced with the name of the spool queue. The <var class= 117 "LITERAL">:lp</var> literal is now the path to the output 118 device the <b class="APPLICATION">lpd</b> server will use to 119 print the job. The <var class="LITERAL">:filter</var> literal 120 specifies the filter program to use to process the job before 121 sending to the output device.</p> 122 123 <p>Here is another example of a printcap entry using the <var 124 class="LITERAL">%P</var> notation:</p> 125 126 <div class="INFORMALEXAMPLE"> 127 <a name="AEN1735"></a> 128<pre class="SCREEN"> 129 lp:lp=%P@h4.private 130</pre> 131 </div> 132 This entry will cause all jobs sent to the <var class= 133 "LITERAL">lp</var> spool queue to be sent to the <var class= 134 "LITERAL">lp</var> queue on <var class= 135 "LITERAL">server</var>. <var class="LITERAL">%X</var> strings 136 in the printcap entries are expanded as shown: 137 138 <div class="INFORMALTABLE"> 139 <a name="AEN1741"></a> 140 141 <table border="1" frame="border" rules="all" class= 142 "CALSTABLE"> 143 <col> 144 <col> 145 146 <thead> 147 <tr> 148 <th>Key</th> 149 150 <th>Replaced By</th> 151 </tr> 152 </thead> 153 154 <tbody> 155 <tr> 156 <td><var class="LITERAL">%P</var></td> 157 158 <td>printcap entry primary name (printer)</td> 159 </tr> 160 161 <tr> 162 <td><var class="LITERAL">%Q</var></td> 163 164 <td>queue requested</td> 165 </tr> 166 167 <tr> 168 <td><var class="LITERAL">%h</var></td> 169 170 <td>short host name (host)</td> 171 </tr> 172 173 <tr> 174 <td><var class="LITERAL">%H</var></td> 175 176 <td>fully qualified host name 177 (host.dns.whatever)</td> 178 </tr> 179 180 <tr> 181 <td><var class="LITERAL">%R</var></td> 182 183 <td>remote printer (rp value)</td> 184 </tr> 185 186 <tr> 187 <td><var class="LITERAL">%M</var></td> 188 189 <td>remote host (rm value)</td> 190 </tr> 191 192 <tr> 193 <td><var class="LITERAL">%D</var></td> 194 195 <td>date in YYYY-MM-DD format</td> 196 </tr> 197 </tbody> 198 </table> 199 </div> 200 <br> 201 <br> 202 </div> 203 204 <div class="NAVFOOTER"> 205 <hr align="LEFT" width="100%"> 206 207 <table summary="Footer navigation table" width="100%" border= 208 "0" cellpadding="0" cellspacing="0"> 209 <tr> 210 <td width="33%" align="left" valign="top"><a href= 211 "tutorial.htm" accesskey="P">Prev</a></td> 212 213 <td width="34%" align="center" valign="top"><a href= 214 "index.htm" accesskey="H">Home</a></td> 215 216 <td width="33%" align="right" valign="top"><a href= 217 "tutorialconfig.htm" accesskey="N">Next</a></td> 218 </tr> 219 220 <tr> 221 <td width="33%" align="left" valign="top">Print Spooling 222 Tutorial</td> 223 224 <td width="34%" align="center" valign="top"><a href= 225 "tutorial.htm" accesskey="U">Up</a></td> 226 227 <td width="33%" align="right" valign="top">Setting Up the 228 Tutorial Configuration</td> 229 </tr> 230 </table> 231 </div> 232 </body> 233</html> 234 235