<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic lp printing depending on line length in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/lp-printing-depending-on-line-length/m-p/2470743#M775239</link>
    <description>If I want to use different printer classes via an option to the lp command depending on the line length of the file to be printed. What would the easiest way to determine the maximum line length of the file to be printed?&lt;BR /&gt;If the line length &amp;lt; 80 I want to print portrait. If the line length &amp;lt; 132 but &amp;gt; 80, I wnat to print landscape. If the line length &amp;gt; 132 I want to use a different printer option.&lt;BR /&gt;I know I can write an awk script to print the max length. Any other suggestions?&lt;BR /&gt;TIA</description>
    <pubDate>Tue, 05 Dec 2000 19:42:10 GMT</pubDate>
    <dc:creator>eric stewart</dc:creator>
    <dc:date>2000-12-05T19:42:10Z</dc:date>
    <item>
      <title>lp printing depending on line length</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/lp-printing-depending-on-line-length/m-p/2470743#M775239</link>
      <description>If I want to use different printer classes via an option to the lp command depending on the line length of the file to be printed. What would the easiest way to determine the maximum line length of the file to be printed?&lt;BR /&gt;If the line length &amp;lt; 80 I want to print portrait. If the line length &amp;lt; 132 but &amp;gt; 80, I wnat to print landscape. If the line length &amp;gt; 132 I want to use a different printer option.&lt;BR /&gt;I know I can write an awk script to print the max length. Any other suggestions?&lt;BR /&gt;TIA</description>
      <pubDate>Tue, 05 Dec 2000 19:42:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/lp-printing-depending-on-line-length/m-p/2470743#M775239</guid>
      <dc:creator>eric stewart</dc:creator>
      <dc:date>2000-12-05T19:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: lp printing depending on line length</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/lp-printing-depending-on-line-length/m-p/2470744#M775240</link>
      <description>There is the 'wc' command as well.</description>
      <pubDate>Tue, 05 Dec 2000 19:58:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/lp-printing-depending-on-line-length/m-p/2470744#M775240</guid>
      <dc:creator>Rick Garland</dc:creator>
      <dc:date>2000-12-05T19:58:34Z</dc:date>
    </item>
    <item>
      <title>Re: lp printing depending on line length</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/lp-printing-depending-on-line-length/m-p/2470745#M775241</link>
      <description>You could do something like:&lt;BR /&gt;&lt;BR /&gt;if [ `cut -c 80- &lt;FILE&gt;` ]&lt;BR /&gt;then&lt;BR /&gt;    if [ `cut -c 128- &lt;FILE&gt;` ]&lt;BR /&gt;    then&lt;BR /&gt;        lp -d LINEPRINTER&lt;BR /&gt;    else&lt;BR /&gt;        lp -d LANDSCAPE&lt;BR /&gt;    fi&lt;BR /&gt;else&lt;BR /&gt;    lp -d PORTRAIT&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;But doing it with awk is more elegant.&lt;/FILE&gt;&lt;/FILE&gt;</description>
      <pubDate>Tue, 05 Dec 2000 22:11:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/lp-printing-depending-on-line-length/m-p/2470745#M775241</guid>
      <dc:creator>Alan Riggs</dc:creator>
      <dc:date>2000-12-05T22:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: lp printing depending on line length</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/lp-printing-depending-on-line-length/m-p/2470746#M775242</link>
      <description>You could also use "fold" maybe in combination with "wc", but still the easiest is awk.&lt;BR /&gt;&lt;BR /&gt;wc &lt;FILE&gt; vs. fold &lt;FILE&gt; | wc &lt;BR /&gt;awk 'length &amp;gt; 80' &lt;FILE&gt;&lt;BR /&gt;&lt;/FILE&gt;&lt;/FILE&gt;&lt;/FILE&gt;</description>
      <pubDate>Wed, 06 Dec 2000 07:49:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/lp-printing-depending-on-line-length/m-p/2470746#M775242</guid>
      <dc:creator>Tommy Palo</dc:creator>
      <dc:date>2000-12-06T07:49:30Z</dc:date>
    </item>
    <item>
      <title>Re: lp printing depending on line length</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/lp-printing-depending-on-line-length/m-p/2470747#M775243</link>
      <description>Hi Eric,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;As 'wc' won't report the longest line length,&lt;BR /&gt;'awk' would be a lot more practical to use.&lt;BR /&gt;You can use 'fold' as well to fold your lines so that they will fit on your printed document.&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;&lt;BR /&gt;Dan&lt;BR /&gt;</description>
      <pubDate>Wed, 06 Dec 2000 07:59:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/lp-printing-depending-on-line-length/m-p/2470747#M775243</guid>
      <dc:creator>Dan Hetzel</dc:creator>
      <dc:date>2000-12-06T07:59:43Z</dc:date>
    </item>
  </channel>
</rss>

