<?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: Printer Issue in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/printer-issue/m-p/5272653#M656475</link>
    <description>&lt;!--!*#--&gt;&amp;gt;but still I am getting the errors as printers not found.&lt;BR /&gt;&lt;BR /&gt;I had to clean up -p spacing and look at only the first line:&lt;BR /&gt;&lt;BR /&gt;for i in $(&amp;lt; /sys_script/P_list); do&lt;BR /&gt;   printerstatus=$(lpstat -p$i | awk '{print $5; exit}')&lt;BR /&gt;   if [ "$printerstatus" != "enabled" ]; then&lt;BR /&gt;      enable $i&lt;BR /&gt;      echo "$i printer is enabled on $(date)" &amp;gt;&amp;gt; /var/adm/printer/file_log&lt;BR /&gt;   fi&lt;BR /&gt;done</description>
    <pubDate>Wed, 09 Feb 2011 00:02:26 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2011-02-09T00:02:26Z</dc:date>
    <item>
      <title>Printer Issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/printer-issue/m-p/5272650#M656472</link>
      <description>Hi Gurus,&lt;BR /&gt;&lt;BR /&gt;I have written a script for enabling printers when it is disabled and i have placed in cron for every 30 minutes to check that.&lt;BR /&gt;&lt;BR /&gt;Please see the script for that.&lt;BR /&gt;&lt;BR /&gt;for i in `cat /sys_script/P_list`&lt;BR /&gt;do&lt;BR /&gt;printerstatus=`lpstat -p\`echo $i\`|awk {'print $5'}`&lt;BR /&gt;&lt;BR /&gt;if [ $printerstatus!= "enabled" ]&lt;BR /&gt;then&lt;BR /&gt;enable $i&lt;BR /&gt;echo "$i printer is enabled on `date`" &amp;gt;&amp;gt; /var/adm/printer/file_log&lt;BR /&gt;&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;cp /var/adm/printer/file_log /var/adm/printer/file_old1&lt;BR /&gt;cp /var/adm/printer/file_old1 /var/adm/printer/file_old2&lt;BR /&gt;cp /var/adm/printer/file_old2 /var/adm/printer/file_old3&lt;BR /&gt;cp /var/adm/printer/file_old3 /var/adm/printer/file_old4&lt;BR /&gt;cp /var/adm/printer/file_old4 /var/adm/printer/file_old5&lt;BR /&gt;&lt;BR /&gt;exit&lt;BR /&gt;&lt;BR /&gt;But now i am gettin an following error for that.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;lpstat: printer "qaz0102s" non-existent&lt;BR /&gt;/sys_script/P_list[9]: test: Specify a parameter with this command.&lt;BR /&gt;lpstat: printer "BOGA_CC" non-existent&lt;BR /&gt;/sys_script/P_list[9]: test: Specify a parameter with this command.&lt;BR /&gt;lpstat: printer "CLIF_CC" non-existent&lt;BR /&gt;/sys_script/P_list[9]: test: Specify a parameter with this command.&lt;BR /&gt;lpstat: printer "CLIF_CC" non-existent&lt;BR /&gt;/sys_script/P_list[9]: test: Specify a parameter with this command.&lt;BR /&gt;lpstat: printer "CLIF_CC" non-existent...&lt;BR /&gt;&lt;BR /&gt;Please see this and do reply since its an urgent issue.</description>
      <pubDate>Thu, 03 Feb 2011 19:34:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/printer-issue/m-p/5272650#M656472</guid>
      <dc:creator>citprabhu</dc:creator>
      <dc:date>2011-02-03T19:34:09Z</dc:date>
    </item>
    <item>
      <title>Re: Printer Issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/printer-issue/m-p/5272651#M656473</link>
      <description>&lt;!--!*#--&gt;&amp;gt;Please see the script for that.&lt;BR /&gt;&lt;BR /&gt;You need to clean it up:&lt;BR /&gt;for i in $(&amp;lt; /sys_script/P_list); do&lt;BR /&gt;   printerstatus=$(lpstat -p $i | awk '{print $5}')&lt;BR /&gt;   if [ "$printerstatus" != "enabled" ]; then&lt;BR /&gt;      enable $i&lt;BR /&gt;      echo "$i printer is enabled on $(date)" &amp;gt;&amp;gt; /var/adm/printer/file_log&lt;BR /&gt;   fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;In particular use $() vs ```.  Replace evil cat.&lt;BR /&gt;No need for $(echo $i), just use $i.&lt;BR /&gt;But most important is fixing quoting and spacing in that "if".  And swapping the single quoting vs {} in awk.</description>
      <pubDate>Sat, 05 Feb 2011 09:59:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/printer-issue/m-p/5272651#M656473</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-02-05T09:59:07Z</dc:date>
    </item>
    <item>
      <title>Re: Printer Issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/printer-issue/m-p/5272652#M656474</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I followed the above steps as mentioned by you but still i am getting the errors as printers not found.&lt;BR /&gt;&lt;BR /&gt;Please let me know for a script i which to enable a printers if its disabled actually in HP-UX.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Prabhakar.</description>
      <pubDate>Tue, 08 Feb 2011 22:46:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/printer-issue/m-p/5272652#M656474</guid>
      <dc:creator>citprabhu</dc:creator>
      <dc:date>2011-02-08T22:46:35Z</dc:date>
    </item>
    <item>
      <title>Re: Printer Issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/printer-issue/m-p/5272653#M656475</link>
      <description>&lt;!--!*#--&gt;&amp;gt;but still I am getting the errors as printers not found.&lt;BR /&gt;&lt;BR /&gt;I had to clean up -p spacing and look at only the first line:&lt;BR /&gt;&lt;BR /&gt;for i in $(&amp;lt; /sys_script/P_list); do&lt;BR /&gt;   printerstatus=$(lpstat -p$i | awk '{print $5; exit}')&lt;BR /&gt;   if [ "$printerstatus" != "enabled" ]; then&lt;BR /&gt;      enable $i&lt;BR /&gt;      echo "$i printer is enabled on $(date)" &amp;gt;&amp;gt; /var/adm/printer/file_log&lt;BR /&gt;   fi&lt;BR /&gt;done</description>
      <pubDate>Wed, 09 Feb 2011 00:02:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/printer-issue/m-p/5272653#M656475</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-02-09T00:02:26Z</dc:date>
    </item>
    <item>
      <title>Re: Printer Issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/printer-issue/m-p/5272654#M656476</link>
      <description>Thanks alot for the posting it resolved my issue.</description>
      <pubDate>Wed, 09 Feb 2011 21:03:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/printer-issue/m-p/5272654#M656476</guid>
      <dc:creator>citprabhu</dc:creator>
      <dc:date>2011-02-09T21:03:51Z</dc:date>
    </item>
    <item>
      <title>Re: Printer Issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/printer-issue/m-p/5272655#M656478</link>
      <description>&lt;P&gt;&amp;gt;Thanks a lot for the posting&lt;BR /&gt;&lt;BR /&gt;If you are happy with the answers you were given please read the following about reopening threads and assigning points:&lt;BR /&gt;&lt;A href="http://h30499.www3.hp.com/t5/help/faqpage/faq-category-id/kudos#kudos" target="_blank"&gt;http://h30499.www3.hp.com/t5/help/faqpage/faq-category-id/kudos#kudos&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2011 18:45:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/printer-issue/m-p/5272655#M656478</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-08-08T18:45:14Z</dc:date>
    </item>
  </channel>
</rss>

