<?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: while true loop in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/while-true-loop/m-p/4846647#M394152</link>
    <description>Yeah, that's what the while-true construct does.&lt;BR /&gt;&lt;BR /&gt;To get out of that loop you'll have to do a CTRL-C&lt;BR /&gt;&lt;BR /&gt;What exactly do you want the script to do?  Do you want it to execute once?  Do you want it to prompt the user before it executes again?&lt;BR /&gt;&lt;BR /&gt;We need more info before we can effectively help you.</description>
    <pubDate>Thu, 03 Oct 2002 03:19:09 GMT</pubDate>
    <dc:creator>Patrick Wallek</dc:creator>
    <dc:date>2002-10-03T03:19:09Z</dc:date>
    <item>
      <title>while true loop</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/while-true-loop/m-p/4846646#M394151</link>
      <description>hi guys,&lt;BR /&gt;&lt;BR /&gt;I've written the following script to cancel a printer jobs queue but the script keeps prompting asking for an input again:&lt;BR /&gt;&lt;BR /&gt;while true &lt;BR /&gt;do&lt;BR /&gt;echo "enter printer name ?\c"&lt;BR /&gt;read ANSW&lt;BR /&gt;cancel -e $ANSW&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;appreciate you advise and support..&lt;BR /&gt;</description>
      <pubDate>Thu, 03 Oct 2002 03:14:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/while-true-loop/m-p/4846646#M394151</guid>
      <dc:creator>Norman_21</dc:creator>
      <dc:date>2002-10-03T03:14:33Z</dc:date>
    </item>
    <item>
      <title>Re: while true loop</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/while-true-loop/m-p/4846647#M394152</link>
      <description>Yeah, that's what the while-true construct does.&lt;BR /&gt;&lt;BR /&gt;To get out of that loop you'll have to do a CTRL-C&lt;BR /&gt;&lt;BR /&gt;What exactly do you want the script to do?  Do you want it to execute once?  Do you want it to prompt the user before it executes again?&lt;BR /&gt;&lt;BR /&gt;We need more info before we can effectively help you.</description>
      <pubDate>Thu, 03 Oct 2002 03:19:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/while-true-loop/m-p/4846647#M394152</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2002-10-03T03:19:09Z</dc:date>
    </item>
    <item>
      <title>Re: while true loop</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/while-true-loop/m-p/4846648#M394153</link>
      <description>Hi,&lt;BR /&gt;The read statement is inside the while loop and hence as long as the while loop is true, it will prompt you for the input. Take the read statement out of the while loop.&lt;BR /&gt;&lt;BR /&gt;BTW, what exactly are you trying. If you just need to cancel the jobs of a specific printer, just take away the loop and execute the rest of the commands. &lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Balajio</description>
      <pubDate>Thu, 03 Oct 2002 03:33:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/while-true-loop/m-p/4846648#M394153</guid>
      <dc:creator>Balaji N</dc:creator>
      <dc:date>2002-10-03T03:33:17Z</dc:date>
    </item>
    <item>
      <title>Re: while true loop</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/while-true-loop/m-p/4846649#M394154</link>
      <description>Hi,&lt;BR /&gt;The read statement is inside the while loop and hence as long as the while loop is true, it will prompt you for the input. Take the read statement out of the while loop.&lt;BR /&gt;&lt;BR /&gt;BTW, what exactly are you trying. If you just need to cancel the jobs of a specific printer, just take away the loop and execute the rest of the commands. &lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Balaji</description>
      <pubDate>Thu, 03 Oct 2002 03:34:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/while-true-loop/m-p/4846649#M394154</guid>
      <dc:creator>Balaji N</dc:creator>
      <dc:date>2002-10-03T03:34:32Z</dc:date>
    </item>
    <item>
      <title>Re: while true loop</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/while-true-loop/m-p/4846650#M394155</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;You can modify your script like this,&lt;BR /&gt;&lt;BR /&gt;while true&lt;BR /&gt;do&lt;BR /&gt;echo "enter printer name ?\c"&lt;BR /&gt;read ANSW&lt;BR /&gt;if [ x"$ANSW" = "x" ]&lt;BR /&gt;then&lt;BR /&gt;   echo "program exit"&lt;BR /&gt;   exit&lt;BR /&gt;fi&lt;BR /&gt;cancel -e $ANSW&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;If you just press "enter" at the question, the program will quit !!&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Patrick</description>
      <pubDate>Thu, 03 Oct 2002 03:42:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/while-true-loop/m-p/4846650#M394155</guid>
      <dc:creator>Patrick Chim</dc:creator>
      <dc:date>2002-10-03T03:42:02Z</dc:date>
    </item>
    <item>
      <title>Re: while true loop</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/while-true-loop/m-p/4846651#M394156</link>
      <description>If you want to cancel everything in all of the printer queue you can do this ..&lt;BR /&gt;&lt;BR /&gt;for printername in $(lpstat|grep \^printer|awk '{print $4}')&lt;BR /&gt;do&lt;BR /&gt;cancel -e $printername&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;This command extract all the printername configured in your system.&lt;BR /&gt;$ lpstat|grep \^printer|awk '{print $4}'&lt;BR /&gt;&lt;BR /&gt;Not sure if this is what you want.</description>
      <pubDate>Thu, 03 Oct 2002 03:46:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/while-true-loop/m-p/4846651#M394156</guid>
      <dc:creator>S.K. Chan</dc:creator>
      <dc:date>2002-10-03T03:46:30Z</dc:date>
    </item>
    <item>
      <title>Re: while true loop</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/while-true-loop/m-p/4846652#M394157</link>
      <description>Hi guys,&lt;BR /&gt;&lt;BR /&gt;I realy appreciate your prompt reply. However, I was not sure if I removed the loop&lt;BR /&gt;the script will cancel the whole bunch of a specific printer jobs. I'll try and see what happens?&lt;BR /&gt;</description>
      <pubDate>Thu, 03 Oct 2002 07:26:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/while-true-loop/m-p/4846652#M394157</guid>
      <dc:creator>Norman_21</dc:creator>
      <dc:date>2002-10-03T07:26:19Z</dc:date>
    </item>
    <item>
      <title>Re: while true loop</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/while-true-loop/m-p/4846653#M394158</link>
      <description>Hi,&lt;BR /&gt;From the man pages of cancel.&lt;BR /&gt;&lt;SNIP&gt;&lt;BR /&gt;  -e             Empty the spool queue of all requests for each printer.&lt;BR /&gt;                     Only users with appropriate privileges can use this&lt;BR /&gt;                     option.&lt;BR /&gt;&lt;/SNIP&gt;&lt;BR /&gt;&lt;BR /&gt;So, if ur root and run cancel -e &lt;PRINTERNAME&gt;, it will cancel all requests.&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;-balaji&lt;/PRINTERNAME&gt;</description>
      <pubDate>Thu, 03 Oct 2002 08:19:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/while-true-loop/m-p/4846653#M394158</guid>
      <dc:creator>Balaji N</dc:creator>
      <dc:date>2002-10-03T08:19:07Z</dc:date>
    </item>
    <item>
      <title>Re: while true loop</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/while-true-loop/m-p/4846654#M394159</link>
      <description>Closed...</description>
      <pubDate>Thu, 24 Feb 2005 12:57:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/while-true-loop/m-p/4846654#M394159</guid>
      <dc:creator>Norman_21</dc:creator>
      <dc:date>2005-02-24T12:57:11Z</dc:date>
    </item>
  </channel>
</rss>

