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>Selecting the Print Queue</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= 14 "Printing a File and Checking Status" href= 15 "printingandchecking.htm"> 16 <link rel="NEXT" title="Controlling the Print Queue" href= 17 "controllingprintqueue.htm"> 18 </head> 19 20 <body class="SECT1" bgcolor="#FFFFFF" text="#000000" link= 21 "#0000FF" vlink="#840084" alink="#0000FF"> 22 <div class="NAVHEADER"> 23 <table summary="Header navigation table" width="100%" border= 24 "0" cellpadding="0" cellspacing="0"> 25 <tr> 26 <th colspan="3" align="center">LPRng Reference Manual: 5 27 Sep 2003 (For LPRng-3.8.22)</th> 28 </tr> 29 30 <tr> 31 <td width="10%" align="left" valign="bottom"><a href= 32 "printingandchecking.htm" accesskey="P">Prev</a></td> 33 34 <td width="80%" align="center" valign="bottom">Chapter 4. 35 Print Spooling Tutorial</td> 36 37 <td width="10%" align="right" valign="bottom"><a href= 38 "controllingprintqueue.htm" accesskey="N">Next</a></td> 39 </tr> 40 </table> 41 <hr align="LEFT" width="100%"> 42 </div> 43 44 <div class="SECT1"> 45 <h1 class="SECT1"><a name="SELECTINGPRINTQUEUE">4.6. 46 Selecting the Print Queue</a></h1> 47 48 <p>In the previous section we used the default print queue. 49 How does <b class="APPLICATION">LPRng</b> determine what 50 print queue to use? First, you can explicitly specify the 51 printer using the <tt class="COMMAND">lpq -Pprintqueue</tt> 52 option and the <tt class="COMMAND">lpq -a</tt> or <tt class= 53 "COMMAND">lpq -Pall</tt> to select all print queues:</p> 54 55 <div class="INFORMALEXAMPLE"> 56 <a name="AEN1953"></a> 57<pre class="SCREEN"> 58 <samp class="PROMPT">h4: {111} %</samp> <kbd class= 59"USERINPUT">lpq -Plp</kbd> 60 Printer: lp@h4 61 Queue: no printable jobs in queue 62 <samp class="PROMPT">h4: {112} %</samp> <kbd class= 63"USERINPUT">lpq -Plp2</kbd> 64 Printer: lp2@h4 65 Queue: no printable jobs in queue 66 <samp class="PROMPT">h4: {113} %</samp> <kbd class= 67"USERINPUT">lpq -a</kbd> 68 Printer: lp@h4 69 Queue: no printable jobs in queue 70 Printer: lp2@h4 71 Queue: no printable jobs in queue 72</pre> 73 </div> 74 <br> 75 <br> 76 77 <p>You can combine the <tt class="COMMAND">lpq -a</tt> with 78 the <tt class="COMMAND">lpq -s</tt> option for a summary 79 listing:</p> 80 81 <div class="INFORMALEXAMPLE"> 82 <a name="AEN1964"></a> 83<pre class="SCREEN"> 84 <samp class="PROMPT">h4: {114} %</samp> <kbd class= 85"USERINPUT">lpq -a</kbd> 86 Printer: lp@h4 87 Queue: no printable jobs in queue 88 Printer: lp2@h4 89 Queue: no printable jobs in queue 90 <samp class="PROMPT">h4: {115} %</samp> <kbd class= 91"USERINPUT">lpq -s -a</kbd> 92 lp@h4 0 jobs 93 lp2@h4 0 jobs 94</pre> 95 </div> 96 <br> 97 <br> 98 99 <p>There is another way to explicitly specify the printqueues 100 listed by <tt class="COMMAND">lpq -a</tt>; see the <a href= 101 "printcappath.htm#ALLPC"><var class="LITERAL">all</var> 102 Printcap Entry</a> for details.</p> 103 104 <p>Users can set their default printer by using the <var 105 class="ENVAR">PRINTER</var> (highest priority), <var class= 106 "ENVAR">LPDEST</var> (next), <var class= 107 "ENVAR">NPRINTER</var> (next), and <var class= 108 "ENVAR">NGPRINTER</var> (lowest priority), environment 109 variables. For example:</p> 110 111 <div class="INFORMALEXAMPLE"> 112 <a name="AEN1979"></a> 113<pre class="SCREEN"> 114 <samp class="PROMPT">h4: {116} %</samp> <kbd class= 115"USERINPUT">setenv PRINTER lp2</kbd> 116 <samp class="PROMPT">h4: {117} %</samp> <kbd class= 117"USERINPUT">lpq</kbd> 118 Printer: lp2@h4 119 Queue: no printable jobs in queue 120 <samp class="PROMPT">h4: {118} %</samp> <kbd class= 121"USERINPUT">unsetenv PRINTER</kbd> 122 <samp class="PROMPT">h4: {119} %</samp> <kbd class= 123"USERINPUT">lpq</kbd> 124 Printer: lp@h4 125 Queue: no printable jobs in queue 126</pre> 127 </div> 128 <br> 129 <br> 130 131 <p>If the printer is not specified on the command line or by 132 the environment variables, then the first printer in the 133 printcap database will be used and then the default printer 134 in the configuration database, and finally the compile time 135 default. <a href="lprngclients.htm#PRINTERINFO">Printer and 136 Server Information</a> for details.</p> 137 </div> 138 139 <div class="NAVFOOTER"> 140 <hr align="LEFT" width="100%"> 141 142 <table summary="Footer navigation table" width="100%" border= 143 "0" cellpadding="0" cellspacing="0"> 144 <tr> 145 <td width="33%" align="left" valign="top"><a href= 146 "printingandchecking.htm" accesskey="P">Prev</a></td> 147 148 <td width="34%" align="center" valign="top"><a href= 149 "index.htm" accesskey="H">Home</a></td> 150 151 <td width="33%" align="right" valign="top"><a href= 152 "controllingprintqueue.htm" accesskey="N">Next</a></td> 153 </tr> 154 155 <tr> 156 <td width="33%" align="left" valign="top">Printing a File 157 and Checking Status</td> 158 159 <td width="34%" align="center" valign="top"><a href= 160 "tutorial.htm" accesskey="U">Up</a></td> 161 162 <td width="33%" align="right" valign="top">Controlling 163 the Print Queue</td> 164 </tr> 165 </table> 166 </div> 167 </body> 168</html> 169 170