<?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 Re: Formatting output in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/formatting-output/m-p/4956213#M414744</link>
    <description>Use as,&lt;BR /&gt;&lt;BR /&gt;while read printer;&lt;BR /&gt;do&lt;BR /&gt;  &lt;BR /&gt;   lpstat -i${printer} | grep idle&lt;BR /&gt;&lt;BR /&gt;done &amp;lt; /home/mayub/script/printer_name.txt&lt;BR /&gt;&lt;BR /&gt;--&lt;BR /&gt;Muthu</description>
    <pubDate>Wed, 01 Feb 2006 01:04:19 GMT</pubDate>
    <dc:creator>Muthukumar_5</dc:creator>
    <dc:date>2006-02-01T01:04:19Z</dc:date>
    <item>
      <title>Formatting output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/formatting-output/m-p/4956206#M414737</link>
      <description>I am running one script to check the printers of the system and mail it to me. It is working fine. But the format is not good. I want each printer will be in a separate line.&lt;BR /&gt;&lt;BR /&gt;i am using the following script&lt;BR /&gt;for i in $(cat /home/mayub/script/printer_name.txt)&lt;BR /&gt;do&lt;BR /&gt;x=`lpstat -p$i |grep idle`&lt;BR /&gt;echo $x&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;The oupput is &lt;BR /&gt;&lt;BR /&gt;printer ausyd01pr305 is idle. enabled since Dec 8 11:07 printer ausyd01pr315 is idle. enabled since Dec 8 11:09 printer ausyd01pr300 is idle. enabled since Jan 24 16:02 printer ausyd01pr306 is idle. enabled since Jan 27 16:37 printer ausyd01pr307 is idle. enabled since Jan 27 16:38 printer ausyd01pr308 is idle. enabled since Jan 27 16:38 printer ausyd01pr311 is idle. enabled since Jan 27 16:39 printer ausyd01pr312 is idle. enabled since Jan 27 16:39 printer ausyd01pr314 is idle. enabled since Jan 27 16:40 printer ausyd01pr330 is idle. enabled since Jan 27 16:40 printer ausyd01pr336 is idle. enabled since Jan 27 16:41 printer ausyd01pr344 is idle. enabled since Jan 27 16:41 printer ausyd01pr345 is idle. enabled since Jan 27 16:42 printer ausyd01pr350 is idle. enabled since Jan 27 16:42 printer ausyd01pr353 is idle. enabled since Jan 27 16:43 printer ausyd01pr359 is idle. enabled since Jan 27 16:43 printer ausyd01pr363 is idle. enabled since Jan 27 16:44 printer ausyd01pr364 is idle. enabled since Jan 27 16:44 printer ausyd01pr365 is idle. enabled since Jan 27 16:45 printer ausyd01pr369 is idle. enabled since Jan 27 16:46 printer ausyd01pr370 is idle. enabled since Jan 27 16:46 printer ausyd01pr372 is idle. enabled since Jan 27 16:47 printer ausyd01pr380 is idle. enabled since Jan 27 16:47 printer ausyd01pr401 is idle. enabled since Jan 27 16:48 printer ausyd01pr351 is idle. enabled since Jan 30 16:12&lt;BR /&gt;&lt;BR /&gt;I want out put like that&lt;BR /&gt;&lt;BR /&gt;printer ausyd01pr305 is idle. enabled since Dec 8 11:07&lt;BR /&gt;printer ausyd01pr315 is idle. enabled since Dec 8 11:09&lt;BR /&gt;printer ausyd01pr300 is idle. enabled since Jan 24 16:02&lt;BR /&gt;printer ausyd01pr306 is idle. enabled since Jan 27 16:37&lt;BR /&gt;&lt;BR /&gt;so on</description>
      <pubDate>Tue, 31 Jan 2006 19:11:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/formatting-output/m-p/4956206#M414737</guid>
      <dc:creator>Khashru</dc:creator>
      <dc:date>2006-01-31T19:11:01Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/formatting-output/m-p/4956207#M414738</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Change your script a bit.&lt;BR /&gt;&lt;BR /&gt;x=`lpstat -p$i |grep idle`&lt;BR /&gt;echo $x&lt;BR /&gt;&lt;BR /&gt;instead use &lt;BR /&gt;&lt;BR /&gt;echo $x &amp;gt;&amp;gt; /tmp/p.out&lt;BR /&gt;&lt;BR /&gt;Also each time before starting &lt;BR /&gt;&lt;BR /&gt;rm /tmp/p.out&lt;BR /&gt;&lt;BR /&gt;Chan</description>
      <pubDate>Tue, 31 Jan 2006 19:14:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/formatting-output/m-p/4956207#M414738</guid>
      <dc:creator>Chan 007</dc:creator>
      <dc:date>2006-01-31T19:14:04Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/formatting-output/m-p/4956208#M414739</link>
      <description>I get the formatted output when i un the script from console. but when i mail it it looses its format. How can i solve that.</description>
      <pubDate>Tue, 31 Jan 2006 19:33:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/formatting-output/m-p/4956208#M414739</guid>
      <dc:creator>Khashru</dc:creator>
      <dc:date>2006-01-31T19:33:37Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/formatting-output/m-p/4956209#M414740</link>
      <description>Try adding "\n" in your script for next line. &lt;BR /&gt;&lt;BR /&gt;That should solve your problem &lt;BR /&gt;Chan</description>
      <pubDate>Tue, 31 Jan 2006 19:37:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/formatting-output/m-p/4956209#M414740</guid>
      <dc:creator>Chan 007</dc:creator>
      <dc:date>2006-01-31T19:37:59Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/formatting-output/m-p/4956210#M414741</link>
      <description>I have tried but having problem.&lt;BR /&gt;&lt;BR /&gt;what will be the syntext&lt;BR /&gt;&lt;BR /&gt;lpstat -p$i |grep idle \n</description>
      <pubDate>Tue, 31 Jan 2006 19:41:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/formatting-output/m-p/4956210#M414741</guid>
      <dc:creator>Khashru</dc:creator>
      <dc:date>2006-01-31T19:41:00Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/formatting-output/m-p/4956211#M414742</link>
      <description>it can be like echo $i \n</description>
      <pubDate>Tue, 31 Jan 2006 19:48:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/formatting-output/m-p/4956211#M414742</guid>
      <dc:creator>Chan 007</dc:creator>
      <dc:date>2006-01-31T19:48:41Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/formatting-output/m-p/4956212#M414743</link>
      <description>Where should i put that</description>
      <pubDate>Tue, 31 Jan 2006 19:53:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/formatting-output/m-p/4956212#M414743</guid>
      <dc:creator>Khashru</dc:creator>
      <dc:date>2006-01-31T19:53:38Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/formatting-output/m-p/4956213#M414744</link>
      <description>Use as,&lt;BR /&gt;&lt;BR /&gt;while read printer;&lt;BR /&gt;do&lt;BR /&gt;  &lt;BR /&gt;   lpstat -i${printer} | grep idle&lt;BR /&gt;&lt;BR /&gt;done &amp;lt; /home/mayub/script/printer_name.txt&lt;BR /&gt;&lt;BR /&gt;--&lt;BR /&gt;Muthu</description>
      <pubDate>Wed, 01 Feb 2006 01:04:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/formatting-output/m-p/4956213#M414744</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2006-02-01T01:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/formatting-output/m-p/4956214#M414745</link>
      <description>Problem solved. i have used "\n" in the end of echo line.</description>
      <pubDate>Wed, 01 Feb 2006 01:07:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/formatting-output/m-p/4956214#M414745</guid>
      <dc:creator>Khashru</dc:creator>
      <dc:date>2006-02-01T01:07:58Z</dc:date>
    </item>
  </channel>
</rss>

