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>Chaining Filters</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="Filters " href="filters.htm"> 12 <link rel="PREVIOUS" title="lpr binary (-l) format" href= 13 "x7980.htm"> 14 <link rel="NEXT" title= 15 "Filter Command Line Options and Environment Variables " href= 16 "filteroptions.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 "x7980.htm" accesskey="P">Prev</a></td> 32 33 <td width="80%" align="center" valign="bottom">Chapter 34 16. Filters</td> 35 36 <td width="10%" align="right" valign="bottom"><a href= 37 "filteroptions.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="CHAININGFILTERS">16.7. Chaining 45 Filters</a></h1> 46 47 <p>If a filter command has a pipe (<var class= 48 "LITERAL">|</var>) or IO redirection indicator (<var class= 49 "LITERAL"><</var> or <var class="LITERAL">></var>) in 50 it, or starts with an open parenthesis (<var class= 51 "LITERAL">(</var>), the filter is run by passing the entire 52 command to the shell specified by the <var class= 53 "LITERAL">shell</var> configuration option. This allows a 54 wide variety of options and operations to be carried out. The 55 <var class="LITERAL">$*</var> value should be used to have 56 the filter options passed to the correct entry in the filter 57 chain.</p> 58 59 <p>For example,</p> 60 61 <div class="INFORMALEXAMPLE"> 62 <a name="AEN7999"></a> 63<pre class="SCREEN"> 64 lp: 65 :filter=( echo "starting `date`" >/var/log/status; /usr/local/ifhp $* ) 66</pre> 67 </div> 68 <br> 69 <br> 70 </div> 71 72 <div class="NAVFOOTER"> 73 <hr align="LEFT" width="100%"> 74 75 <table summary="Footer navigation table" width="100%" border= 76 "0" cellpadding="0" cellspacing="0"> 77 <tr> 78 <td width="33%" align="left" valign="top"><a href= 79 "x7980.htm" accesskey="P">Prev</a></td> 80 81 <td width="34%" align="center" valign="top"><a href= 82 "index.htm" accesskey="H">Home</a></td> 83 84 <td width="33%" align="right" valign="top"><a href= 85 "filteroptions.htm" accesskey="N">Next</a></td> 86 </tr> 87 88 <tr> 89 <td width="33%" align="left" valign="top"><b class= 90 "APPLICATION">lpr</b> binary (-l) format</td> 91 92 <td width="34%" align="center" valign="top"><a href= 93 "filters.htm" accesskey="U">Up</a></td> 94 95 <td width="33%" align="right" valign="top">Filter Command 96 Line Options and Environment Variables</td> 97 </tr> 98 </table> 99 </div> 100 </body> 101</html> 102 103