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>Using :oh To Select Printcap Information</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="Printcap Database " href=
12    "printcapref.htm">
13    <link rel="PREVIOUS" title="Simple Server Printcap Example"
14    href="cm.htm">
15    <link rel="NEXT" title="Using the Wildcard Printcap Entry"
16    href="x5758.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          "cm.htm" accesskey="P">Prev</a></td>
32
33          <td width="80%" align="center" valign="bottom">Chapter
34          12. Printcap Database</td>
35
36          <td width="10%" align="right" valign="bottom"><a href=
37          "x5758.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="AEN5732">12.4. Using :oh To Select
45      Printcap Information</a></h1>
46
47      <p>When administering a large number of printers over a large
48      area, it is sometimes desirable to have a <span class=
49      "emphasis"><i class="EMPHASIS">default</i></span> printer for
50      each host. This default printer may be different for each
51      host, and can be selected by using the <var class=
52      "LITERAL">oh</var> entry. The <var class="LITERAL">oh</var>
53      value is a list of the following entries</p>
54
55      <div class="INFORMALEXAMPLE">
56        <a name="AEN5738"></a>
57<pre class="SCREEN">
58    [!] IP/n     - address + mask length    10.0.0.0/8
59    [!] IP/IP    - address + mask           10.0.0.0/255.0.0.0
60    [!] vvv      - glob for hostname        pc*.org.com
61</pre>
62      </div>
63      <br>
64      <br>
65
66      <p>The <b class="APPLICATION">LPRng</b> software will
67      determine the hostnames and IP addresses assigned to the host
68      and then check to see if there is a match in the listed
69      hostnames or IP addresses. The optional test inversion (<var
70      class="LITERAL">!</var>) causes the sense of the match to be
71      inverted. The list of addresses or entries are tested in
72      sequence until a match is found. If no match is found the
73      printcap entry will not be used. For example:</p>
74
75      <div class="INFORMALEXAMPLE">
76        <a name="AEN5743"></a>
77<pre class="SCREEN">
78    lp:oh=*.admin.org.com,10.0.0.5,10.2.0.0/16:lp=pr1@server1
79    lp:oh=*.eng.org.com:lp=hp@server2
80    color:oh=*.eng.org.com:lp=color@server3
81    color:oh=!*.eng.org.com:lp=color@server4
82</pre>
83      </div>
84      <br>
85      <br>
86
87      <p>In the above example, if our host name is <tt class=
88      "FILENAME">booster.admin.org.com</tt>, then we would use <var
89      class="LITERAL">lp=pr1@server1</var>, as the <tt class=
90      "FILENAME">*.admin.org.com</tt> glob pattern would match our
91      host name.</p>
92
93      <p>if our host name is <tt class=
94      "FILENAME">booster.dev.org.com</tt> and our IP address is
95      10.2.0.1, then we would use <var class=
96      "LITERAL">lp=pr1@server1</var>, as the <tt class=
97      "FILENAME">10.2.0.0/16</tt> ip address would be in the
98      specified address range.</p>
99
100      <p>Finally we have an example of the use of the match
101      inversion operator (<var class="LITERAL">!</var>). All hosts
102      whose name matches <tt class="FILENAME">*.eng.org.com</tt>
103      will use <var class="LITERAL">color@server3</var> and the
104      others will use <var class="LITERAL">color@server4</var>.</p>
105    </div>
106
107    <div class="NAVFOOTER">
108      <hr align="LEFT" width="100%">
109
110      <table summary="Footer navigation table" width="100%" border=
111      "0" cellpadding="0" cellspacing="0">
112        <tr>
113          <td width="33%" align="left" valign="top"><a href=
114          "cm.htm" accesskey="P">Prev</a></td>
115
116          <td width="34%" align="center" valign="top"><a href=
117          "index.htm" accesskey="H">Home</a></td>
118
119          <td width="33%" align="right" valign="top"><a href=
120          "x5758.htm" accesskey="N">Next</a></td>
121        </tr>
122
123        <tr>
124          <td width="33%" align="left" valign="top">Simple Server
125          Printcap Example</td>
126
127          <td width="34%" align="center" valign="top"><a href=
128          "printcapref.htm" accesskey="U">Up</a></td>
129
130          <td width="33%" align="right" valign="top">Using the
131          Wildcard Printcap Entry</td>
132        </tr>
133      </table>
134    </div>
135  </body>
136</html>
137
138