$! ------------------ CUT HERE ----------------------- $ v='f$verify(f$trnlnm("SHARE_UNPACK_VERIFY"))' $! $! This archive created by VMS_SHARE Version 8.3 $! On 1-JUN-1993 11:48:11.55 By user GOATHUNTER (@WKUVX1.BITNET) $! $! The VMS_SHARE software that created this archive $! was written by Andy Harper, Kings College London UK $! -- December 1992 $! $! Credit is due to these people for their original ideas: $! James Gray, Michael Bednarek $! $! TO UNPACK THIS SHARE FILE, CONCATENATE ALL PARTS IN ORDER $! AND EXECUTE AS A COMMAND PROCEDURE ( @name ) $! $! THE FOLLOWING FILE(S) WILL BE CREATED AFTER UNPACKING: $! 1. SUPUSR.DESC;1 $! 2. SUPUSR.DSJ;1 $! $set="set" $set symbol/scope=(nolocal,noglobal) $f=f$parse("SHARE_UNPACK_TEMP","SYS$SCRATCH:."+f$getjpi("","PID")) $e="write sys$error ""%UNPACK"", " $w="write sys$output ""%UNPACK"", " $ if .not. f$trnlnm("SHARE_UNPACK_LOG") then $ w = "!" $ if f$getsyi("CPU") .gt. 127 then $ goto start $ ve=f$getsyi("version") $ if ve-f$extract(0,1,ve) .ges. "4.4" then $ goto start $ e "-E-OLDVER, Must run at least VMS 4.4" $ v=f$verify(v) $ exit 44 $unpack: subroutine ! P1=filename, P2=checksum, P3=attributes $ if f$parse(P1) .nes. "" then $ goto dirok $ dn=f$parse(P1,,,"DIRECTORY") $ w "-I-CREDIR, Creating directory ''dn'" $ create/dir 'dn' $ if $status then $ goto dirok $ e "-E-CREDIRFAIL, Unable to create ''dn' File skipped" $ delete 'f'* $ exit $dirok: $ x=f$search(P1) $ if x .eqs. "" then $ goto file_absent $ e "-W-EXISTS, File ''P1' exists. Skipped" $ delete 'f'* $ exit $file_absent: $ w "-I-UNPACK, Unpacking file ", P1 $ n=P1 $ if P3 .nes. "" then $ n=f $ if .not. f$verify() then $ define/user sys$output nl: $ EDIT/TPU/NOSEC/NODIS/COM=SYS$INPUT 'f'/OUT='n' PROCEDURE GetHex(s,p)LOCAL x1,x2;x1:=INDEX(t,SUBSTR(s,p,1))-1;x2:=INDEX(t, SUBSTR(s,p+1,1))-1;RETURN 16*x1+x2;ENDPROCEDURE; PROCEDURE SkipPartsep LOOP EXITIF MARK(NONE)=END_OF(b);EXITIF INDEX(ERASE_LINE, "-+-+-+-+-+-+-+-+")=1;ENDLOOP;ENDPROCEDURE;PROCEDURE ProcessLine LOCAL c,s,l,b, n,p;c := ERASE_CHARACTER(1);s := ERASE_LINE;IF c = "X" THEN SPLIT_LINE; ENDIF; MOVE_HORIZONTAL(-1);l := LENGTH(s);p := 1;LOOP EXITIF p > l;c := SUBSTR(s,p,1); p := p+1;CASE c FROM ' ' TO '`' ['`']: COPY_TEXT(ASCII(GetHex(s,p))); p:=p+2;[ ' ']: p:=p+1;[INRANGE,OUTRANGE]: COPY_TEXT(c);ENDCASE;ENDLOOP;ENDPROCEDURE; PROCEDURE Decode POSITION(BEGINNING_OF(b));LOOP EXITIF MARK(NONE)=END_OF(b); IF INDEX(CURRENT_LINE,"+-+-+-+-+-+-+-+-")=1 THEN SkipPartSep;ELSE ProcessLine; MOVE_HORIZONTAL(1);ENDIF;ENDLOOP;ENDPROCEDURE;SET(FACILITY_NAME,"UNPACK");SET( SUCCESS,OFF);SET(INFORMATIONAL,OFF);t:="0123456789ABCDEF";f:=GET_INFO( COMMAND_LINE,"file_name");b:=CREATE_BUFFER(f,f);Decode;WRITE_FILE(b,GET_INFO( COMMAND_LINE,"output_file"));QUIT; $ if p3 .eqs. "" then $ goto dl $ open/write fdl &f $ write fdl "RECORD" $ write fdl P3 $ close fdl $ w "-I-CONVRFM, Converting record format to ", P3 $ convert/fdl=&f &f-1 &P1 $dl: delete 'f'* $ checksum 'P1' $ if checksum$checksum .nes. P2 then $ - e "-E-CHKSMFAIL, Checksum of ''P1' failed." $ exit $ endsubroutine $start: $! $ create 'f' XThis`20file`20contains`20code`20previously`20published`20in`20the`20May/June V`201993`20issue`20of`20 XDigital`20Systems`20Journal.`20It`20was`20originally`20run`20on`20page`2019, V`20as`20part`20of`20 XRussell`20Salerno's`20article,`20"SUPERUSER:`20An`20Enhanced`20$SHOW`20USERS V`20Utility."`20 XThe`20code`20here`20is`20a`20$SHOW`20USER`20utility`20with`20the`20addition V`20of`20imagename,`20 Xforceexit`20ability`20and`20stopid`20ability,`20as`20well`20as`20selection`20c Vriteria.`20It`20 Xuses`20a`20CLI`20interface`20so`20it`20can`20be`20used`20from`20batch.`20The V`20selection`20criteria`20 Xpermit`20mass`20stop/ID`20and`20mass`20forcex. $ call unpack SUPUSR.DESC;1 1869568963 "" $! $ create 'f' X$`20basic`20superuser X$`20link`20`20superuser X$`20set`20command`20superuser X$`20library/insert`20sys$help:helplib.hlb`20superuser X X`0C X Xdefine`20verb`20superuser X`09image`20dev$disk:`5Bruss.super`5Dsuperuser X X`09qualifier`20username X`09`09value X`09`09nonnegatable X X`09qualifier`20process X`09`09value X`09`09nonnegatable X X`09qualifier`20image X`09`09value`20(type=$file) X`09`09nonnegatable X X`09qualifier`20select X`09`09value`20(type=process_options) X`09`09nonnegatable X X`09qualifier`20output X`09`09value`20(type=$file,`20default="SUPERUSER.LIS") X`09`09nonnegatable X X`09qualifier`20stop X`09`09nonnegatable X X`09qualifier`20force_exit X`09`09nonnegatable X X`09qualifier`20confirm X`09`09default X X`09disallow`20stop`20and`20force_exit X`09disallow`20stop`20and`20output X`09disallow`20force_exit`20and`20output X`09disallow`20(confirm`20or`20neg`20confirm)`20and`20not`20(stop`20or`20force_ Vexit) X X Xdefine`20type`20process_options X`09keyword`20other`20 X`09keyword`20network`20 X`09keyword`20batch`20 X`09keyword`20interactive,`20default X`09keyword`20detached`20 X`09keyword`20local`20 X`09keyword`20dialup`20 X`09keyword`20remote`20 X`09keyword`20all X X`0C X Xprogram`20superuser X!`20+ X!`09`20`20`20`20`20`20`20author`09:`09Russell`20Salerno X! X!`09`20`20module`20name`09:`09superuser X! X!`09`20`20description`09:`09A`20program`20that`20works`20like`20$`20SHOW`20USE VRS`20 X!`09`09`09`09but`20shows`20you`20the`20image`20name`20and`20base`20 X!`09`09`09`09priority.`20`20It`20will`20also`20let`20you`20specify`20 X!`09`09`09`09users`20by`20the`20image`20they`20are`20running,`20and X!`09`09`09`09allow`20you`20to`20stop`20a`20process`20or`20terminate X!`09`09`09`09the`20image. X! X!`20- X X X`09option`20type`20=`20explicit X`09on`20error`20goto`20error_handler X X`09%include`20"$jpidef"`20%from`20%library`20"sys$library:basic$starlet.tlb" X X`09external`20long`20function`09sys$getjpiw`09`20`09`09`09`26 X`09,`09`09`09sys$fao`09`09`20`09`09`09`26 X`09,`09`09`09sys$delprc`09`20`09`09`09`26 X`09,`20`20`20`09`09`09sys$forcex`09`20`09`09`09`26 X`09,`09`09`09lib$trim_filespec`09`09`09`26 X`09,`09`20`20`20`20`20`20`20`09`09lib$date_time`09`09`09`09`26 X`09,`09`09`09cli$get_value`09`09`09`09`26 X`09,`09`09`09cli$present`09`09`09`09`26 X`09,`09`09`09sor$begin_sort`09`09`09`09`26 X`09,`09`09`09sor$release_rec`09`09`09`09`26 X`09,`09`09`09sor$sort_merge`09`09`09`09`26 X`09,`09`09`09sor$return_rec X X`09external`20long`20constant`09ss$_normal`09`09`09`09`26 X`09,`09`09`09ss$_badparam`09`09`09`09`26 X`09,`09`09`09ss$_accvio`09`09`09`09`26 X`20`20`20`09,`09`09`09ss$_ivlognam`09`09`09`09`26 X`20`20`20`09,`09`09`09ss$_nomoreproc`09`09`09`09`26 X`09,`09`09`09ss$_nonexpr`09`09`09`09`26 X`20`20`20`09,`09`09`09ss$_nopriv`09`09`09`09`26 X`20`20`20`09,`09`09`09ss$_suspended`09`09`09`09`26 X`09,`09`09`09ss$_endoffile X X`20`09external`20word`20constant`20`09dsc$k_dtype_t X X`09record`20item X`09`09word`20buff_len X`09`09word`20item_code X`09`09long`20buff_addr X`09`09long`20ret_addr X`09end`20record X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20`20`20`20`20`20`20`20`20`20 X`09map`20(itms)`09item`09item_list(10%) X X`09map`20(iostat)`20`20`09string`09iosb`20=`208% X`09map`20(iostat)`09long`09iosb_1`20`09`09`09`09`09`26 X`09,`09`09`09iosb_2 X X`09map`20(prt)`09string`09p_user`20=`2012%`09`09`09`09`26 X`09,`09`09`09fill`20=`201%`09`09`09`09`26 X`09,`09`09`09p_proc`20=`2015%`09`09`09`09`26 X`09,`09`09`09fill`20=`201%`09`09`09`09`26 X`09,`09`09`09p_pid`20=`208%`09`09`09`09`26 X`09,`09`09`09fill`20=`201%`09`09`09`09`26 X`09,`09`09`09p_prib`20=`203%`09`09`09`09`26 X`09,`09`09`09fill`20=`201%`09`09`09`09`26 X`09,`09`09`09p_term`20=`207%`09`09`09`09`26 X`09,`09`09`09fill`20=`201%`09`09`09`09`26 X`09,`09`09`09p_image`20=`2029%`09`09`09`09`26 X`09,`09`09`09fill`20=`201%`09`09`09`09`26 X`09,`09`09`09p_xtra`20=`201% X X`09map`20(prt)`09string`20`09p_all`20=`2079% X`20`20`20`20`20`20`20`20`20`20`20`20`20 X`09map`20(str)`20`09string`09timestamp`20=`2023%`09`09`09`09`26 X`09,`09`09`09out_str`20=`2080% X X`09map`20(srtrec)`20`09string`09user_name`20=`2012%`09`09`09`09`26 X`09,`09`20`20`20`20`20`20`09`09process_name`20=`2015%`09`09`09`26 X`09,`09`09`09term_name`20=`207%`09`09`09`09`26 X`09,`09`09`09image_name`20=`2080%`09`09`09`26 X`09,`09`09long`09pid`09`09`09`09`09`26 X`09,`09`09`09prib X`09map`20(srtrec)`20`09string`09srt_all`20=`20122% X X`09declare`20byte`09username_choice`09`09`09`09`09`26 X`09,`09`09image_choice`09`09`09`09`09`26 X`09,`09`09output_choice`09`09`09`09`09`26 X`09,`09`09process_choice`09`09`09`09`09`26 X`09,`09`09select_choice`09`09`09`09`09`26 X`09,`09`09stop_choice`09`09`09`09`09`26 X`09,`09`09exit_choice`09`09`09`09`09`26 X`09,`09`09confirm_choice X X`09declare`20word`20`09key_info(4%) X X`09declare`20long`09sys_status`09`09`09`09`09`26 X`09,`09`09pidadr`09`20`20`20`09`09`09`09`09`26 X`09,`09`09proc_mode`09`09`09`09`09`26 X`09,`09`09jobtype`09`09`09`09`09`09`26 X`09,`09`09item_list_addr`09`09`09`09`09`26 X`09,`09`09iosb_addr`09`09`09`09`09`26 X`09,`09`09ret_len(10)`09`09`09`09`09`26 X`09,`09`09username_choice_str_len`09`09`09`09`26 X`09,`09`09image_choice_str_len`09`09`09`09`26 X`09,`09`09output_choice_str_len`09`09`09`09`26 X`09,`09`09process_choice_str_len`09`09`09`09`26 X`09,`09`09select_choice_str_len`09`09`09`09`26 X`09,`09`09record_count`09`09`09`09`09`26 X`09,`09`09record_length`09`09`09`09`09`26 X`09,`09`09out_chan X X X`09declare`20string`09username_choice_str`09`09`09`09`26 X`09,`09`09image_choice_str`09`09`09`09`26 X`09,`09`09output_choice_str`09`09`09`09`26 X`09,`09`09process_choice_str`09`09`09`09`26 X`09,`09`09select_choice_str`09`09`09`09`26 X`09,`09`09answer`09`09`09`09`09`09`26 X`09,`09`09title_str1`09`09`09`09`09`26 X`09,`09`09title_str2`09`09`09`09`09`26 X`09,`09`09out_device X X`09declare`20byte`20constant`20`09true`20=`20-1%`09`09`09`09`26 X`09,`20`09`09`09false`20=`200%`09`09`09`09`26 X`09,`09`09`09out_file`20=`201% X X X X X`09!`20Main`20program`20block X X`09gosub`20get_cli_info`20 X`09gosub`20initialize_getjpi X`09gosub`20get_user_info X`09gosub`20process_user_info X X`09goto`20exit_program X X Xget_cli_info: X`09!`20Get`20qualifiers`20and`20values`20chosen`20by`20the`20user X X`09username_choice`20=`20true`20if`20(cli$get_value('USERNAME',`20username_cho Vice_str,`20username_choice_str_len)`20and`20X"00000001"L)`20=`201% X`09image_choice`20=`20true`20if`20(cli$get_value('IMAGE',`20image_choice_str, V`20image_choice_str_len)`20and`20X"00000001"L)`20=`201% X`09output_choice`20=`20true`20if`20(cli$get_value('OUTPUT',`20output_choice_st Vr,`20output_choice_str_len)`20and`20X"00000001"L)`20=`201% X`09process_choice`20=`20true`20if`20(cli$get_value('PROCESS',`20process_choice V_str,`20process_choice_str_len)`20and`20X"00000001"L)`20=`201% X`09stop_choice`20=`20true`20if`20(cli$present('STOP')`20and`20X"00000001"L) V`20=`201% X`09exit_choice`20=`20true`20if`20(cli$present('FORCE_EXIT')`20and`20X"00000001 V"L)`20=`201% X`09confirm_choice`20=`20true`20if`20(cli$present('CONFIRM')`20and`20X"00000001 V"L)`20=`201% X`09call`20cli$get_value('SELECT',`20select_choice_str,`20select_choice_str_len V) X`09sys_status`20=`20lib$date_time(timestamp) X X`09!`20If`20/OUTPUT`20was`20chosen,`20our`20output`20device`20is`20the`20filen Vame.`20 X`09!`20Otherwise,`20it`20is`20SYS$OUTPUT X X`09if`20output_choice`20then X`09`20`20`20out_device`20=`20output_choice_str X`09else X`20`20`20`20`20`20`20`20`20`20`20out_device`20=`20"sys$output" X`09end`20if X X`20`20`20`20`20`20`20`20call`20lib$get_lun(out_chan) X`20`20`20`20`20`20`20`20open`20out_device`20for`20output`20as`20file`20#out_ch Van X`09nomargin`20#out_chan X X`09return X Xinitialize_getjpi: X X`09!`20set`20up`20item`20list`20 X X`09item_list_addr`20=`20loc(item_list(0)::buff_len) X`09iosb_addr`20=`20loc(iosb_1) X`09pidadr`20=`20-"1"l X X`09item_list(0)::buff_len`20`20=`20len(image_name) X`09item_list(0)::item_code`20=`20jpi$_imagname X`09item_list(0)::buff_addr`20=`20loc(image_name) X`09item_list(0)::ret_addr`20`20=`20loc(ret_len(0)) X X`09item_list(1)::buff_len`20`20=`204% X`09item_list(1)::item_code`20=`20jpi$_pid X`09item_list(1)::buff_addr`20=`20loc(pid) X`09item_list(1)::ret_addr`20`20=`20loc(ret_len(1)) X X`09item_list(2)::buff_len`20`20=`20len(process_name) X`09item_list(2)::item_code`20=`20jpi$_prcnam X`09item_list(2)::buff_addr`20=`20loc(process_name) X`09item_list(2)::ret_addr`20`20=`20loc(ret_len(2)) X X`09item_list(3)::buff_len`20`20=`20len(user_name) X`09item_list(3)::item_code`20=`20jpi$_username X`09item_list(3)::buff_addr`20=`20loc(user_name) X`09item_list(3)::ret_addr`20`20=`20loc(ret_len(3)) X X`09item_list(4)::buff_len`20`20=`20len(term_name) X`09item_list(4)::item_code`20=`20jpi$_terminal X`09item_list(4)::buff_addr`20=`20loc(term_name) X`09item_list(4)::ret_addr`20`20=`20loc(ret_len(4)) X X`09item_list(5)::buff_len`20`20=`204% X`09item_list(5)::item_code`20=`20jpi$_mode X`09item_list(5)::buff_addr`20=`20loc(proc_mode) X`09item_list(5)::ret_addr`20`20=`20loc(ret_len(5)) X X`09item_list(6)::buff_len`20`20=`204% X`09item_list(6)::item_code`20=`20jpi$_prib X`09item_list(6)::buff_addr`20=`20loc(prib) X`09item_list(6)::ret_addr`20`20=`20loc(ret_len(6)) X X`09item_list(7)::item_code,item_list(7)::buff_len`20=`200 X X`09!`20set`20up`20report`20titles X X`09select_choice`20=`20true X`09select`20left$(select_choice_str,`201%) X`09`20`20`20case`20"O" X`09`20`20`20`20`20`20title_str1`20=`20"Other`20Processes" X`09`20`20`20`20`20`20title_str2`20=`20"other`20processes" X`09`20`20`20`20`20`20jobtype`20=`20jpi$k_other X`09`20`20`20case`20"N" X`09`20`20`20`20`20`20title_str1`20=`20"Network`20Users" X`09`20`20`20`20`20`20title_str2`20=`20"network`20users" X`09`20`20`20`20`20`20jobtype`20=`20jpi$k_network X`09`20`20`20case`20"B" X`09`20`20`20`20`20`20title_str1`20=`20"Batch`20Processes" X`09`20`20`20`20`20`20title_str2`20=`20"batch`20processes" X`09`20`20`20`20`20`20jobtype`20=`20jpi$k_batch X`09`20`20`20case`20"D" X`09`20`20`20`20`20`20title_str1`20=`20"Detached`20Processes" X`09`20`20`20`20`20`20title_str2`20=`20"detached`20processes" X`09`20`20`20`20`20`20jobtype`20=`20jpi$k_detached X`09`20`20`20case`20"L" X`09`20`20`20`20`20`20title_str1`20=`20"Local`20Processes" X`09`20`20`20`20`20`20title_str2`20=`20"local`20processes" X`09`20`20`20`20`20`20jobtype`20=`20jpi$k_local X`09`20`20`20case`20"D" X`09`20`20`20`20`20`20title_str1`20=`20"Dialup`20Users" X`09`20`20`20`20`20`20title_str2`20=`20"dialup`20users" X`09`20`20`20`20`20`20jobtype`20=`20jpi$k_dialup X`09`20`20`20case`20"R" X`09`20`20`20`20`20`20title_str1`20=`20"Remote`20Users" X`09`20`20`20`20`20`20title_str2`20=`20"remote`20users" X`09`20`20`20`20`20`20jobtype`20=`20jpi$k_dialup X`09`20`20`20case`20"A" X`09`20`20`20`20`20`20title_str1`20=`20"Processes" X`09`20`20`20`20`20`20title_str2`20=`20"processes" X`09`20`20`20`20`20`20select_choice`20=`20false X`09`20`20`20case`20else X`09`20`20`20`20`20`20title_str1`20=`20"Interactive`20Users" X`09`20`20`20`20`20`20title_str2`20=`20"interactive`20users" X`09`20`20`20`20`20`20jobtype`20=`20jpi$k_interactive X`09end`20select X X`09return X X Xget_user_info: X X`09!`20call`20getjpi,`20and`20see`20which`20processes`20meet`20our`20criteria X X`09while`20sys_status`20<>`20ss$_nomoreproc X`09`20`20`20sys_status`20=`20sys$getjpiw`20`20(`09`20`09`09`20`20`20`20`20! V`20efn`20`20`20`20`20`20`20`20`20`20!`20`26 X`09`09`09`09,`20pidadr`20by`20ref`09`09`20`20`20`20`20!`20pid`20wildcard`20! V`20`26 X`09`09`09`09,`09`09`20`09`20`20`20`20`20!`20proc`20name`20`20`20`20!`20`26 X`09`09`09`09,`20item_list(0)`20by`20ref`09`20`20`20`20`20!`20addr`20of`20i.l. V`20!`20`26 X`09`09`09`09,`20iosb`20by`20ref`09`20`20`20`20`20`09`20`20`20`20`20!`20iosb V`09`20`20`20`20!`20`26 X`09`09`09`09,`09`09`09`20`20`20`20`20!`20astadr`20`20`20`20`20`20`20!`20`26 X`09`09`09`09,`09`09`09`20`20`20`20`20!`20astprm`20`20`20`20`20`20`20!`20) X X`09`20`20`20select`20sys_status X`09`20`20`20`20`20`20case`20ss$_normal,`20ss$_suspended X`09`09`20`20`20`20if`20((not`20select_choice)`20`20or`20(proc_mode`20=`20jobty Vpe))`09`09`09`09`09`20`26 X`09`09`09`09and`09`09`09`09`09`09`09`09`09`20`26 X`09`09`20`20`20`20`20`20((not`20username_choice)`20or`20(edit$(user_name,4%) V`20=`20username_choice_str))`09`09`20`26 X`09`09`09`09and`09`09`09`09`09`09`09`09`09`20`26 X`09`09`20`20`20`20`20`20((not`20process_choice)`20`20or`20(edit$(process_name, V4%)`20=`20process_choice_str))`09`09`20`26 X`09`09`09`09and`09`09`09`09`09`09`09`09`09`20`26 X`09`09`20`20`20`20`20`20((not`20image_choice)`20`20`20`20or`20(pos(edit$(image V_name,4%),`20image_choice_str,`201%)`20<>`200%))`20then X`09`09`20`20`20`20`20`20`20gosub`20send_to_sort`20 X`09`09`20`20`20`20end`20if X`09`20`20`20`20`20`20case`20ss$_nomoreproc,`20ss$_nopriv X`09`20`20`20`20`20`20case`20else X`09`09call`20lib$stop(sys_status`20by`20value) X`09`20`20`20end`20select X`09next X`09return X X Xsend_to_sort: X X`09!`20init`20sort`20first`20time`20through X X`09gosub`20initialize_sort`20if`20record_count`20=`200%`20 X X`09!`20send`20record`20to`20the`20sort`20utility X X`09sys_status`20=`20sor$release_rec(srt_all) X`09call`20lib$stop(sys_status`20by`20value)`20if`20sys_status`20<>`20ss$_norma Vl X`09record_count`20=`20record_count`20+`201% X X`09return X X Xinitialize_sort: X X`09!`20set`20up`20sort`20parameters... X X`09record_length`20=`20len(srt_all) X`09key_info(0%)`20=`201%`09`09!`201`20key X`09key_info(1%)`20=`20dsc$k_dtype_t`09!`20key`20type`20is`20'string' X`09key_info(2%)`20=`200%`09`09!`20ascending`20order X`09key_info(3%)`20=`200%`09`09!`20start`20position X`09key_info(4%)`20=`2012%`09`09!`20key`20length X X`09!`20...and`20initialize`20sort`20utility X X`09sys_status`20=`20sor$begin_sort(key_info(0%),`20record_length) X`09call`20lib$stop(sys_status`20by`20value)`20if`20sys_status`20<>`20ss$_norma Vl X X`09return X X Xprocess_user_info: X X`09!`20If`20we`20found`20any`20matching`20processes,`20lets X`09!`20sort`20them`20and`20take`20approprite`20action: X X`09if`20record_count`20=`200%`20then X`09`20`20`20print`20#out_chan X`09`20`20`20print`20#out_chan;`20"No`20matching`20processes`20found." X`09else X`09`20`20`20sys_status`20=`20sor$sort_merge() X`09`20`20`20p_all`20=`20"`20" X`09`20`20`20if`20stop_choice`20or`20exit_choice`20then X`09`20`20`20`20`20`20gosub`20stop_or_forcex X`09`20`20`20else X`09`20`20`20`20`20`20gosub`20show_users X`09`20`20`20end`20if X`20`09end`20if X X`20`09return X X Xstop_or_forcex: X`09set`20no`20prompt`09`09!`20we`20don't`20want`20BASIC's`20default`20prompt X`09record_count`20=`200% X`09sys_status`20=`20sor$return_rec(srt_all) X`09while`20sys_status`20<>`20ss$_endoffile X`09`20`20`20gosub`20format_output X`09`20`20`20if`20confirm_choice`20then X`09`20`20`20`20`20`20if`20stop_choice`20then X`09`20`20`20`20`20`20`20`20`20print`20#out_chan;`20"STOP`20PROCESS`20"`20+`20e Vdit$(p_all,`20144%)`20+`20"`20?`20`5BN`5D:`20";`20`5C`20input`20answer X`09`20`20`20`20`20`20else X`09`20`20`20`20`20`20`20`20`20print`20#out_chan;`20"FORCE`20IMAGE`20EXIT`20ON V`20PROCESS`20"`20+`20edit$(p_all,`20144%)`20+`20"`20?`20`5BN`5D:`20";`20`5C V`20input`20answer X`09`20`20`20`20`20`20end`20if X`09`20`20`20`20`20`20answer`20=`20edit$(answer,`2032%) X`09`20`20`20`20`20`20select`20answer X`09`20`09`20case`20"A" X`09`20`20`20`20`20`20`20`20`20`20`20`20confirm_choice`20=`20false`09!`20Proces Vs`20all`20the`20rest`20w/o`20asking X`09`20`09`20case`20"Q" X`09`09`20`20`20`20sys_status`20=`20ss$_endoffile`09!`20Flag`20the`20exit`20con Vdition X`09`09`20`20`20`20iterate X`09`20`20`20`20`20`20end`20select`09`20`20`20`20`20`20 X`09`20`20`20end`20if X`09`20`20`20if`20(not`20confirm_choice)`20or`20edit$(answer,`2032%)`20=`20"Y" V`20then X`09`20`20`20`20`20`20if`20stop_choice`20then X`09`20`20`20`20`20`20`20`20`20sys_status`20=`20sys$delprc(pid`20by`20ref,) X`09`20`20`20`20`20`20`20`20`20print`20#out_chan;`20"PROCESS`20"`20+`20edit$(p_ Vall,`20144%)`20+`20"`20STOPPED" X`09`20`20`20`20`20`20else X`09`20`20`20`20`20`20`20`20`20sys_status`20=`20sys$forcex(pid,,) X`09`20`20`20`20`20`20`20`20`20print`20#out_chan;`20"IMAGE`20"`20+`20edit$(p_im Vage,`20128%)`20+`20"`20TERMINATED`20" X`09`20`20`20`20`20`20end`20if X`09`20`20`20`20`20`20record_count`20=`20record_count`20+`201% X`09`20`20`20end`20if X`09`20`20`20sys_status`20=`20sor$return_rec(srt_all) X`09next X X`09if`20record_count`20=`201%`20then X`09`20`20`20print`20#out_chan X`09`20`20`20if`20stop_choice`20then X`09`20`20`20`20`20`20print`20#out_chan;`20"Total`20of`201`20process`20stopped. V" X`09`20`20`20else X`09`20`20`20`20`20`20print`20#out_chan;`20"Total`20of`201`20image`20terminated V." X`09`20`20`20end`20if X`09else X`09`20`20`20print`20#out_chan X`09`20`20`20if`20stop_choice`20then X`09`20`20`20`20`20`20print`20#out_chan;`20"Total`20of`20"`20+`20num1$(record_c Vount)`20+`20"`20processes`20stopped." X`09`20`20`20else X`09`20`20`20`20`20`20print`20#out_chan;`20"Total`20of`20"`20+`20num1$(record_c Vount)`20+`20"`20images`20terminated." X`09`20`20`20end`20if X`09end`20if X X`09return X X Xshow_users: X`09print`20#out_chan;`20edit$(format$("VAX/VMS`20"`20+`20title_str1,`20"'"`20+ V`20string$(79%,`20ascii("C"))),`20128%) X`09print`20#out_chan;`20edit$(format$(timestamp,`20"'"`20+`20string$(79%,`20as Vcii("C"))),`20128%) X`09print`20#out_chan;`20edit$(format$("Total`20number`20of`20"`20+`20title_str V2`20+`20"`20=`20"`20+`20num1$(record_count),`20"'"`20+`20string$(79%,`20ascii( V"C"))),`20128%) X`09print`20#out_chan X`09print`20#out_chan;`20"Username`20`20`20`20`20Process`20Name`20`20`20`20`20 V`20PID`20`20`20`20BPR`20Term`20`20`20`20Image" X`09sys_status`20=`20sor$return_rec(srt_all) X`09while`20sys_status`20<>`20ss$_endoffile X`09`20`20`20gosub`20format_output X`09`20`20`20print`20#out_chan;`20p_all X`09`20`20`20sys_status`20=`20sor$return_rec(srt_all) X`09next X X`09sys_status`20=`20sys$fao("Total`20of`20!SL`20user!%S.",,out_str,`20record_c Vount`20by`20value) X`09print`20#out_chan X`09print`20#out_chan;`20edit$(out_str,`20132%) X X`09return X Xformat_output: X`09p_user`20=`20edit$(user_name,`204%) X`09p_proc`20=`20edit$(process_name,`204%) X`09p_prib`20=`20format$(prib,`20"###") X`09p_term`20=`20edit$(term_name,`204%) X`09sys_status`20=`20sys$fao("!XL",,p_pid,pid`20by`20value) X`09sys_status`20=`20lib$trim_filespec(image_name,p_image,"29"W) X X`09return X Xerror_handler: X`09print`20#out_chan;`20err,ert$(err);"`20sys_status:";sys_status X`09resume`20exit_program X Xexit_program: X`09close`20#out_chan X X`09end`20program $ call unpack SUPUSR.DSJ;1 86655436 "" $ v=f$verify(v) $ exit