<?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: Shell Script to kill print request in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-kill-print-request/m-p/4156374#M319364</link>
    <description>all the print requests come to the request directory. So you dont need to go behind the request id if the intention to cancel the one day old jobs?</description>
    <pubDate>Fri, 07 Mar 2008 02:59:11 GMT</pubDate>
    <dc:creator>skt_skt</dc:creator>
    <dc:date>2008-03-07T02:59:11Z</dc:date>
    <item>
      <title>Shell Script to kill print request</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-kill-print-request/m-p/4156370#M319360</link>
      <description>&lt;!--!*#--&gt;Hi all, hope you guys can help me out here. I am looking to write a short shell script in hpux to kill all print requests which are older than 1 day.&lt;BR /&gt;&lt;BR /&gt;find /var/spool/lp/request/$PRINTER -mtime +0&lt;BR /&gt;&lt;BR /&gt;Need some advise. THanks in advance.</description>
      <pubDate>Thu, 06 Mar 2008 06:02:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-kill-print-request/m-p/4156370#M319360</guid>
      <dc:creator>Simran_1</dc:creator>
      <dc:date>2008-03-06T06:02:02Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script to kill print request</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-kill-print-request/m-p/4156371#M319361</link>
      <description>for i in `/var/spool/lp/request/$printer -mtime +1`&lt;BR /&gt;do&lt;BR /&gt;rm -rf $i&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Robert</description>
      <pubDate>Thu, 06 Mar 2008 11:23:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-kill-print-request/m-p/4156371#M319361</guid>
      <dc:creator>RobertK_1</dc:creator>
      <dc:date>2008-03-06T11:23:50Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script to kill print request</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-kill-print-request/m-p/4156372#M319362</link>
      <description>Thanks! Appreciated</description>
      <pubDate>Fri, 07 Mar 2008 01:32:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-kill-print-request/m-p/4156372#M319362</guid>
      <dc:creator>Simran_1</dc:creator>
      <dc:date>2008-03-07T01:32:52Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script to kill print request</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-kill-print-request/m-p/4156373#M319363</link>
      <description>Is there any way to use the 'cancel' command to kill the print request by getting the print request ID?&lt;BR /&gt;&lt;BR /&gt;Sorry n00b here..:)</description>
      <pubDate>Fri, 07 Mar 2008 02:18:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-kill-print-request/m-p/4156373#M319363</guid>
      <dc:creator>Simran_1</dc:creator>
      <dc:date>2008-03-07T02:18:10Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script to kill print request</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-kill-print-request/m-p/4156374#M319364</link>
      <description>all the print requests come to the request directory. So you dont need to go behind the request id if the intention to cancel the one day old jobs?</description>
      <pubDate>Fri, 07 Mar 2008 02:59:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-kill-print-request/m-p/4156374#M319364</guid>
      <dc:creator>skt_skt</dc:creator>
      <dc:date>2008-03-07T02:59:11Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script to kill print request</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-kill-print-request/m-p/4156375#M319365</link>
      <description>Santosh,&lt;BR /&gt;Thanks. Lets just say that i do not have root capability...is there any way to do this.&lt;BR /&gt;&lt;BR /&gt;I would like to know if there is a way to 'get' the print request id and parse it in the script...allowing a cancel.&lt;BR /&gt;&lt;BR /&gt;like:&lt;BR /&gt;&lt;BR /&gt;cancel $PRTID&lt;BR /&gt;&lt;BR /&gt;Appreciate the inputs so far.</description>
      <pubDate>Fri, 07 Mar 2008 06:59:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-kill-print-request/m-p/4156375#M319365</guid>
      <dc:creator>Simran_1</dc:creator>
      <dc:date>2008-03-07T06:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script to kill print request</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-kill-print-request/m-p/4156376#M319366</link>
      <description>&lt;!--!*#--&gt;&amp;gt;I would like to know if there is a way to 'get' the print request id and parse it in the script, allowing a cancel.&lt;BR /&gt;&lt;BR /&gt;PRINTER=XXX&lt;BR /&gt;for lp in $(find /var/spool/lp/request/$PRINTER -mtime +1 -name "cA*") ; do&lt;BR /&gt;   # get base, strip off leading "cA", then strip off hostname&lt;BR /&gt;   base=${lp##*/}&lt;BR /&gt;   lp_id=${base#cA}&lt;BR /&gt;   lp_id=${lp_id%$(hostname)}&lt;BR /&gt;   echo cancel $PRINTER-$lp_id&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Remove "echo" when happy.</description>
      <pubDate>Fri, 07 Mar 2008 08:05:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-kill-print-request/m-p/4156376#M319366</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-03-07T08:05:41Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script to kill print request</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-kill-print-request/m-p/4156377#M319367</link>
      <description>Here's an old case statement we set up for helpdesk folks to handle some quick requests on HPUX....it's nothing fancy..&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh &lt;BR /&gt;#&lt;BR /&gt;#&lt;BR /&gt;#&lt;BR /&gt;trap '' INT&lt;BR /&gt;function cont&lt;BR /&gt;{&lt;BR /&gt;print -n "Do You Wish to Continue Y/N : " &lt;BR /&gt;read answ&lt;BR /&gt;if [[ $answ = [Yy] ]]&lt;BR /&gt; then&lt;BR /&gt;  return 0&lt;BR /&gt; else&lt;BR /&gt;  return 1  &lt;BR /&gt;fi&lt;BR /&gt;}&lt;BR /&gt;while true&lt;BR /&gt;do&lt;BR /&gt;clear&lt;BR /&gt;print -n "&lt;BR /&gt;                        * HELP DESK MENU *&lt;BR /&gt;                          $(uname -n)&lt;BR /&gt;                         HELLO: $(whoami)&lt;BR /&gt;        ===================================================&lt;BR /&gt;        1. Run Restricted SAM to reset passwords.&lt;BR /&gt;&lt;BR /&gt;        2. Display printer status / print jobs.&lt;BR /&gt;&lt;BR /&gt;        3. Cancel a print job.&lt;BR /&gt;&lt;BR /&gt;        4. Cancel ALL print jobs for a printer.&lt;BR /&gt;&lt;BR /&gt;        5. EXIT this program and RETURN TO COMMAND LINE.&lt;BR /&gt;        ===================================================&lt;BR /&gt;&lt;BR /&gt;        Select an Option # from above: "&lt;BR /&gt;&lt;BR /&gt;        read answer&lt;BR /&gt;case "$answer" in&lt;BR /&gt;        5*|Qq|bye|Ee ) print "Quitting!  See You Later, $(whoami)" ; exit ;;&lt;BR /&gt;        1) if cont&lt;BR /&gt;                then &lt;BR /&gt;                . /usr/sbin/sam&lt;BR /&gt;            fi;;&lt;BR /&gt;        2) if (( $? == 0 ))&lt;BR /&gt;                then&lt;BR /&gt;                print -n "Enter Printer Name: "&lt;BR /&gt;                read prtr&lt;BR /&gt;           lpstat $prtr&lt;BR /&gt;                print -n "OK to clear screen [Hit Any Key]"&lt;BR /&gt;                read h&lt;BR /&gt;            fi;;&lt;BR /&gt;        3) if (( $? == 0 ))&lt;BR /&gt;                then&lt;BR /&gt;                print -n "Enter Printer Name-job#: "&lt;BR /&gt;                read prtr&lt;BR /&gt;                cancel $prtr&lt;BR /&gt;           fi;;&lt;BR /&gt;        4) if (( $? == 0 ))&lt;BR /&gt;                then&lt;BR /&gt;                print -n "..Enter printer name :"&lt;BR /&gt;                read prtr_name&lt;BR /&gt;                print -n "You enter printer ${prtr_name}"&lt;BR /&gt;                print -n " Is this correct Y/N "&lt;BR /&gt;                read answ&lt;BR /&gt;        if [[ "$answ" = [Yy] ]]&lt;BR /&gt;         then&lt;BR /&gt;         lpstat $prtr_name | grep $prtr_name | sort -k1 | cut -d " " -f1 &amp;gt; $prtr_name.out&lt;BR /&gt;                for rem_prt in `cat $prtr_name.out`&lt;BR /&gt;                do&lt;BR /&gt;                cancel $rem_prt&lt;BR /&gt;                done&lt;BR /&gt;        else&lt;BR /&gt;                echo "No Such Printer"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;           fi;;&lt;BR /&gt;esac&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Number 3 and 4 may assist you..&lt;BR /&gt;Rgrds,&lt;BR /&gt;Rita</description>
      <pubDate>Fri, 07 Mar 2008 13:08:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-kill-print-request/m-p/4156377#M319367</guid>
      <dc:creator>Rita C Workman</dc:creator>
      <dc:date>2008-03-07T13:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script to kill print request</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-kill-print-request/m-p/4156378#M319368</link>
      <description>i hope you are not trying cancel other's job too whihc are more than a day old. A use can cancel only his job</description>
      <pubDate>Fri, 07 Mar 2008 15:44:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-kill-print-request/m-p/4156378#M319368</guid>
      <dc:creator>skt_skt</dc:creator>
      <dc:date>2008-03-07T15:44:20Z</dc:date>
    </item>
  </channel>
</rss>

