/usr/share/doc/lprng-doc/LPRng-Reference-Multipart/simple.htm is in lprng-doc 3.8.A~rc2-3.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="generator" content=
"HTML Tidy for HTML5 for Linux version 5.2.0">
<title>Simple Client Printcap Entry</title>
<meta name="GENERATOR" content=
"Modular DocBook HTML Stylesheet Version 1.79">
<link rel="HOME" title=" LPRng Reference Manual" href=
"index.htm">
<link rel="UP" title="Printcap Database " href="printcapref.htm">
<link rel="PREVIOUS" title="Printcap Database " href=
"printcapref.htm">
<link rel="NEXT" title="Simple Server Printcap Example" href=
"cm.htm">
</head>
<body class="SECT1" bgcolor="#FFFFFF" text="#000000" link="#0000FF"
vlink="#840084" alink="#0000FF">
<div class="NAVHEADER">
<table summary="Header navigation table" width="100%" border=
"0" cellpadding="0" cellspacing="0">
<tr>
<th colspan="3" align="center">LPRng Reference Manual: 24
Sep 2004 (For LPRng-3.8.28)</th>
</tr>
<tr>
<td width="10%" align="left" valign="bottom"><a href=
"printcapref.htm" accesskey="P">Prev</a></td>
<td width="80%" align="center" valign="bottom">Chapter 12.
Printcap Database</td>
<td width="10%" align="right" valign="bottom"><a href=
"cm.htm" accesskey="N">Next</a></td>
</tr>
</table>
<hr align="left" width="100%">
</div>
<div class="SECT1">
<h1 class="SECT1"><a name="SIMPLE" id="SIMPLE">12.2. Simple
Client Printcap Entry</a></h1>
<p>Options used:</p>
<ul>
<li>
<p><tt class="LITERAL">client</tt> FLAG <span class=
"emphasis"><i class="EMPHASIS">client printcap
entry</i></span></p>
</li>
<li>
<p><tt class="LITERAL">lp=</tt><span class=
"emphasis"><i class="EMPHASIS">destination printer
information</i></span></p>
</li>
<li>
<p><tt class="LITERAL">rm=</tt><span class=
"emphasis"><i class="EMPHASIS">remote host
(machine)</i></span></p>
</li>
<li>
<p><tt class="LITERAL">rp=</tt><span class=
"emphasis"><i class="EMPHASIS">remote
printer</i></span></p>
</li>
</ul>
<p>I'll use this simple example to explain the basics of the
<b class="APPLICATION">LPRng</b> printcap format and introduce
some of the <b class="APPLICATION">LPRng</b> network
configuration options. Here is a simple printcap file used to
provide client programs (<tt class="LITERAL">lpr, lprm,</tt>
etc) with <span class="emphasis"><i class="EMPHASIS">remote
printer</i></span> and <span class="emphasis"><i class=
"EMPHASIS">server</i></span> information.</p>
<div class="INFORMALEXAMPLE">
<a name="AEN5537" id="AEN5537"></a>
<pre class="SCREEN"># printer lp1
lp1|printer1
:rm=localhost
# printer lp2 with continuation
lp2:\
:lp=pr@10.0.0.1:client
# printcap lp3, to printer pr, with overrides
lp3:rp=pr:rm=hp.private
:force_localhost@
# Simplest possible printcap entry - defaults for everything
lp4</pre>
</div>
<ol type="1">
<li>
<p>Lines starting with a <tt class="LITERAL">#</tt> sign
are comments, and all leading and trailing <span class=
"emphasis"><i class="EMPHASIS">whitespace</i></span>, i.e.
- spaces, tabs, etc, are ignored. Empty lines are ignored
as well.</p>
</li>
<li>
<p>A printcap entry starts with the printcap entry
<span class="emphasis"><i class="EMPHASIS">name</i></span>,
followed by one or more <span class="emphasis"><i class=
"EMPHASIS">aliases</i></span>, followed by one or more
options. In the above example we have three printcap
entries: <tt class="LITERAL">lp1</tt> with an alias
<tt class="LITERAL">printer1</tt> and <tt class=
"LITERAL">lp2</tt>, <tt class="LITERAL">lp3</tt>, and
<tt class="LITERAL">lp4</tt> with no aliases.</p>
</li>
<li>
<p>Aliases start with the <tt class="LITERAL">|</tt>
character and options with the <tt class="LITERAL">:</tt>
character; tabs and spaces before and after the <tt class=
"LITERAL">|</tt> or <tt class="LITERAL">:</tt> characters
and at the start and end of lines are ignored. You can use
backslash (<tt class="LITERAL">\</tt>) at the end of a line
to create a multi-line value for an option. The backslash
will cause the next line to be appended to the current
line; watch out for comments and ends of printcap entries
if you use this facility. As you can see from the example,
there is no <tt class="LITERAL">Name</tt> printcap entry -
this is part of the <tt class="LITERAL">cm</tt> option on
the previous line.</p>
</li>
<li>
<p>Options take the form of a keyword/value pair, i.e.-</p>
<p class="LITERALLAYOUT">:option=value<br>
:option#value (legacy, not advised for new systems)<br>
:option<br>
:option@</p>
</li>
<li>
<p>Option names are case insensitive, but option values are
not. While <tt class="LITERAL">Ts</tt> and <tt class=
"LITERAL">ts</tt> are the same option name, <tt class=
"LITERAL">ts=Testing</tt> and <tt class=
"LITERAL">ts=testing</tt> have their case preserved. A
string or integer value is specified by <tt class=
"LITERAL">option=value</tt> or <tt class=
"LITERAL">option#value</tt>.</p>
</li>
<li>
<p>The use of the legacy <tt class=
"LITERAL">option#value</tt> form is <acronym class=
"ACRONYM">NOT</acronym> recommended as some preprocessors
and database systems will treat <span class=
"emphasis"><i class="EMPHASIS">#</i></span> as the start of
a comment and delete the remainder of the line. This has
caused great consternation for sysadmins who wonder why
their NIS distributed printcap entries have been
mysteriously truncated.</p>
</li>
<li>
<p>If you want to set a string option to <span class=
"emphasis"><i class="EMPHASIS">empty</i></span> value, use
<tt class="LITERAL">option=</tt>. The <tt class=
"LITERAL">option</tt> will set it to <tt class=
"LITERAL">1</tt>. If an option value contains a colon, then
use the C (or Perl or Tck/Tk) string escape <tt class=
"LITERAL">\072</tt> to represent the value.</p>
</li>
<li>
<p>Boolean options are set TRUE (1) if no value follows the
keyword and FALSE (0) by appending a <tt class=
"LITERAL">@</tt>. For example <tt class="LITERAL">sh</tt>
will set <tt class="LITERAL">sh</tt> to TRUE and <tt class=
"LITERAL">sh@</tt> to FALSE.</p>
</li>
</ol>
<p>There may be multiple options on the same line, separated by
colons.</p>
<p>Now let's examine the first printcap entry in detail. It is
reproduced here for convenience:</p>
<div class="INFORMALEXAMPLE">
<a name="AEN5593" id="AEN5593"></a>
<pre class="SCREEN"># printer lp1
lp1|printer1
:rm=localhost</pre>
</div>
<ol type="1">
<li>
<p>We start with a comment, followed by the printcap entry
name and and alias. Aliases are useful when you want to
refer to a single printer or print queue by different
names. This can be useful in advanced printcap and print
queue setups. By default, the remote printer name is the
printcap entry name.</p>
</li>
<li>
<p>The <tt class="LITERAL">rm</tt> (remote machine or host)
option specifies the name or IP address of the <b class=
"APPLICATION">lpd</b> host running <b class=
"APPLICATION">lpd</b>. In this example the remote host is
<tt class="LITERAL">localhost</tt> or the machine that the
client is running on and we assume that the <b class=
"APPLICATION">lpd</b> server is running on the localhost.
Thus, we would communicate with printer <tt class=
"LITERAL">lp1@localhost</tt>.</p>
</li>
</ol>
<p>Let's look at the next printcap entry:</p>
<div class="INFORMALEXAMPLE">
<a name="AEN5607" id="AEN5607"></a>
<pre class="SCREEN"># printer lp2 with continuation
lp2:\
:lp=pr@10.0.0.1:client</pre>
</div>
<ol type="1">
<li>
<p>The <tt class="LITERAL">lp2</tt> printcap entry
illustrates the use (and abuse) of the <tt class=
"LITERAL">\</tt> continuation. If you think about this, we
have really defined a printcap entry of the form:</p>
<div class="INFORMALEXAMPLE">
<a name="AEN5614" id="AEN5614"></a>
<pre class="SCREEN">lp2: :lp=pr@10.0.0.1:client</pre>
</div>
<p>Luckily, <b class="APPLICATION">LPRng</b> ignores empty
options like <tt class="LITERAL">::</tt>. While it is
strongly recommended that <tt class="LITERAL">\</tt> be
avoided it may be necessary for compatibility with other
system utilities.</p>
</li>
<li>
<p>The <tt class="LITERAL">lp=pr@10.0.0.1</tt> literal is
an alternate way to specify a remote queue and server. If
the <tt class="LITERAL">force_localhost</tt> default is
being used, then the <b class="APPLICATION">LPRng</b>
clients will ignore the <tt class="LITERAL">10.0.0.1</tt>
address and still connect to <tt class=
"LITERAL">pr@localhost</tt>. There is further discussion
about this in the next section.</p>
</li>
<li>
<p>The <tt class="LITERAL">client</tt> option explicitly
labels client only printcap information. The <b class=
"APPLICATION">lpd</b> server will ignore any printcap with
the <tt class="LITERAL">client</tt> option. When
constructing complex printcaps, this option is used to keep
ensure that you have consistent printcap information.</p>
</li>
</ol>The following printcap entry shows how to override the
<tt class="LITERAL">force_localhost</tt> default, and force the
<b class="APPLICATION">LPRng</b> clients to connect directly to
a remote server:
<div class="INFORMALEXAMPLE">
<a name="AEN5634" id="AEN5634"></a>
<pre class="SCREEN">lp3:rp=pr:rm=hp.private
:force_localhost@</pre>
</div>
<ol type="1">
<li>
<p>The <tt class="LITERAL">rp=</tt> (remote printer) remote
print queue name to used when sending commands to the
<b class="APPLICATION">lpd</b> print server.</p>
</li>
<li>
<p>The <tt class="LITERAL">force_localhost@</tt> literal is
an example of a <span class="emphasis"><i class=
"EMPHASIS">flag</i></span> option. The <tt class=
"LITERAL">@</tt> sets the literal value to 0 (false). We
set <tt class="LITERAL">force_localhost</tt> to false,
which now allows the <b class="APPLICATION">LPRng</b>
clients to connect directly to the specified remote
printer. In this example, the <tt class=
"FILENAME">hp.private</tt> could be a HP LaserJet Printer
with a JetDirect interface, which supports the RFC1179
protocol.</p>
</li>
<li>
<p>One disadvantages of sending a job directly to a printer
using the above method is that <b class=
"APPLICATION">lpr</b> program will not terminate or exit
until all of the files have been transferred to the
printer, and this may take a long time as the printer
processes the files as they are received.</p>
</li>
</ol>
<p>Now let's look at the last printcap entry:</p>
<div class="INFORMALEXAMPLE">
<a name="AEN5653" id="AEN5653"></a>
<pre class="SCREEN">
# Simplest possible printcap entry - defaults for everything
lp4</pre>
</div>
<p>The last example is the simplest possible printcap entry.
This will cause <b class="APPLICATION">LPRng</b> clients to use
the default values for everything. The printer will be
<tt class="LITERAL">lp4</tt>, i.e. - the name of the printcap,
and the server will be <tt class="LITERAL">localhost</tt> if
<tt class="LITERAL">force_localhost</tt> is set, or the value
of the <tt class="LITERAL">default_remote_host</tt>
configuration option if it is not.</p>
</div>
<div class="NAVFOOTER">
<hr align="left" width="100%">
<table summary="Footer navigation table" width="100%" border=
"0" cellpadding="0" cellspacing="0">
<tr>
<td width="33%" align="left" valign="top"><a href=
"printcapref.htm" accesskey="P">Prev</a></td>
<td width="34%" align="center" valign="top"><a href=
"index.htm" accesskey="H">Home</a></td>
<td width="33%" align="right" valign="top"><a href="cm.htm"
accesskey="N">Next</a></td>
</tr>
<tr>
<td width="33%" align="left" valign="top">Printcap
Database</td>
<td width="34%" align="center" valign="top"><a href=
"printcapref.htm" accesskey="U">Up</a></td>
<td width="33%" align="right" valign="top">Simple Server
Printcap Example</td>
</tr>
</table>
</div>
<p align="center"></p>
</body>
</html>
|