anyparm parm=; # SP v4.0 - see help text at end of script... # parse command line setvar sp_parm anyparm(!parm) setvar sp_seleq dwns(ltrim(rtrim( word(sp_parm,',;') ))) setvar sp_action dwns(ltrim(rtrim( xword(sp_parm,',;') ))) # process the seleq if len(sp_seleq)=0 setvar sp_seleq 'owner=!hpuser.!hpaccount' elseif sp_seleq='@' setvar sp_seleq 'owner=@.@' elseif sp_seleq='s' setvar sp_seleq 'jobnum=!hpjobtype!hpjobnum' elseif sp_seleq='j' and hplastjob<>'' setvar sp_seleq 'jobnum=!hplastjob' elseif numeric(sp_seleq) setvar sp_seleq 'spoolid=!sp_seleq' elseif numeric(ltrim(sp_seleq,'j')) & or numeric(ltrim(sp_seleq,'s')) setvar sp_seleq 'jobnum=!sp_seleq' elseif sp_seleq='status' setvar sp_seleq 'owner=@.@' setvar sp_action 'status' elseif pos(' !sp_seleq ', & ' ready active open create print problm delpnd spsave defer xfer ')<>0 setvar sp_seleq 'state=!sp_seleq' elseif delimpos(sp_seleq,'<=>')=0 if delimpos(sp_seleq,'.')=0 if delimpos(sp_seleq,'?@#')=0 setvar sp_seleq 'filedes=!sp_seleq or jobname=!sp_seleq' & + ' or dev=!sp_seleq' else setvar sp_seleq 'filedes=!sp_seleq or jobname=!sp_seleq' endif else setvar sp_seleq 'owner=!sp_seleq' endif endif # process the action if len(sp_action)=0 setvar sp_action 'show' endif if numeric(sp_action) setvar sp_action 'pri=!sp_action' endif if sp_action='detail' listspf o@;seleq=[!sp_seleq];detail elseif sp_action='status' listspf o@;seleq=[!sp_seleq];status else errclear continue listspf o@;seleq=[!sp_seleq] >sptmp if cierror<>0 if cierror=4809 echo !hpcierrmsg else print sptmp;page=0 endif escape endif # display just the headers & spoolfile lines from LISTSPF # (suppress all the summary statistics normally displayed at the end) /bin/awk '''NR<=3 || /^#O/''' 'show' setvar sp_cmd 'spoolf o@;seleq=[!sp_seleq];!sp_action' if dwns(input('Perform :!sp_cmd ?(y/N)',,1))='y' echo :!sp_cmd !sp_cmd else echo No action taken. endif endif endif deletevar sp_@ return ________________________________________________________________________ SP - spoofle management for the incurably lazy. v4.0 - jpd - 2/25/2000 usage: sp sp_seleq;sp_action (sp with no parms= sp owner=!hpuser.!hpaccount;show) the important thing to remember here is that everything before the first semicolon (or comma) is considered part of the selection, and everything after the selection is considered an action. sp_seleq may be: * a spoofle number (without the leading # or O) * an @ (indicating all spoofles I can access) # an S (indicating spoofles owned by my session) * a J (indicating spoofles for the last job I streamed) * a job number (WITH the leading J) * a filedes or jobname wildcard pattern * a device class or device name * a state (spsave, open, ready, etc.) * a user.acct pair (shorthand for owner=u.a) # status, shorthand for owner=@.@;status * a selection equation (see :help spoolf parms) (no brackets required) sp_action may be: * ;show, (default) LISTSPF one-liners, no stats summaries * ;detail, indicating listspf ;detail * ;status, indicating listspf ;status (;detail and ;status may not be combined with any other action keywords) * a valid spoolf action parameter (;pri=n, ;delete) (or any reasonable combination of actions) # a number, shorthand for ;pri=n confirmation will be requested when sp_action is other than ;show or ;detail. Any response other than Y or y will cancel the action. examples: sp // show all spoofles owned by me sp @ // show ALL spoofles (that I can see) sp 10145 // show spoofle #o10145 sp j1132;detail // show details on #j1132's spoofles sp owner=mgr and pri>0 // show all spoofles owned by MGR // at higher priority than 0 sp 10145;defer // defer spoofle #o10145 sp defer;undefer // undefer all deferred spoofles sp ?stdlist;status // listspf ;status on all $stdlists // (the ? is a trick to get around // the $ not being valid in jobname) sp @cpl@;pri=11;dev=LP // print all compiler listings on LP // (confirmation requested) sp pri=3;delete // delete all pri 3 spoofles // (confirmation requested) sp j1132;delete // delete all spoofles for #j1132 // (confirmation requested) Jon Diercks