~ UNITOOLS.BCK3' UNITOOLS.BCK#BACK/LO *.COM,.TXT UNITOOLS.BCK/SAV JONATHAN (qwV6.2 _RUBENS::  _DSA20: V6.2 ~ x!*[JONATHAN.UNITOOLS]ACC_DEL.COM;14+,. /( 4P -0123KPWO56޿v7V\ȗv89L wG(HJ $ verify = 'f$verify(0)'P$!------------------------------------------------------------------------------$! ACC_DEL.COM$!.$! Split off OpenVMS accounting file records.$!$! Author: Jonathan Ridler,($! Information Technology Services,$$! The University of Melbourne.$! $! History:$$! 12-Oct-1994 JER Original version.8$! 18-Sep-1995 JER Tiny mods to accounting verification.6$! 17-Apr-1996 JER Eliminate version number conflicts.P$!------------------------------------------------------------------------------$"$ on warning then goto ESCAPE"$ on control_y then goto ESCAPE$$ say := write SYS$OUTPUT<$ ask := read SYS$COMMAND /error=ESCAPE /end=ESCAPE /prompt=$ Pid = f$getjpi ("","PID")8$ out_fyl = f$parse ("ACC_DEL_''PID'.TMP_EXTRACT") - ";"5$ rej_fyl = f$parse ("ACC_DEL_''PID'.TMP_SAVE") - ";"$$GET_P1: $ ask "Accounting filename? " p1&$ p1 = f$edit (p1,"UPCASE,COMPRESS")$$ if p1 .eqs. "" then goto GET_P1&$ p1 = f$element (0,";",f$search (p1))$ if p1 .eqs. ""$ then&$ say "%ERROR, File does not exist!"$ goto GET_P1$ endif$$GET_P2:"$ ask "Accounting qualifiers? " p2$$ p2 = f$edit (p2,"UPCASE,COMPRESS")$$ if p2 .eqs. "" then goto GET_P2$ $GET_ANS0:.$ ask "Validate this selection? (Yes/No) " ans&$ ans = f$edit (ans,"UPCASE,COMPRESS")'$ if ans .eqs. "" then goto GET_ANS0$$ if .not. ans then goto GET_ANS1$5$ say "%Running accounting to validate selection ..."$$ define /user sys$input sys$command$ account /full 'p1' 'p2'"$ say "%Accounting run completed."$ $GET_ANS1:)$ ask "Use this selection? (Yes/No) " ans&$ ans = f$edit (ans,"UPCASE,COMPRESS")'$ if ans .eqs. "" then goto GET_ANS1"$ if .not. ans then goto get_p1$4$ say "%Running accounting to extract selection ..."?$ account /binary /reject='rej_fyl' /output='out_fyl' 'p1' 'p2'"$ say "%Accounting run completed."$ say ""1$ say "%Retained records are in file ''rej_fyl'"1$ say "%Extracted records are in file ''out_fyl'"$ say ""$ $GET_ANS2:/$ ask "Copy ''rej_fyl' to ''p1'? (Yes/No) " ans&$ ans = f$edit (ans,"UPCASE,COMPRESS")'$ if ans .eqs. "" then goto GET_ANS2($ if ans then copy /log 'rej_fyl' 'p1'$ $GET_ANS3:-$ ask "Delete temporary files? (Yes/No) " ans&$ ans = f$edit (ans,"UPCASE,COMPRESS")'$ if ans .eqs. "" then goto GET_ANS33$ if ans then delete /log 'rej_fyl';*,'out_fyl';*$$ESCAPE: $EXIT_DOOR: $ EXIT 1 + 0 * f$verify (verify)*[JONATHAN.UNITOOLS]AI.COM;43+,. /( 4P h-0123KPWO56t@ 7Q)>v89L wG(HJ $ verflg = 'f$verify(0)'P$!------------------------------------------------------------------------------M$! AI.COM Do an Analyze /Image and return the image identification section"$! of the specified image(s).$!$! Usage: @AI [[p1] [p2]]0$! where p1 = image name (can have wildcards).@$! p2 = anything - if present, do NOT display executable$! filename.$!$! Author: Jonathan RIDLER,$$! Information Technology Services, $! The University of Melbourne.$! Date: 15-Aug-1991.P$!------------------------------------------------------------------------------$$ set control=(Y,T)%$ on control_y then goto EXIT_DOOR%$ on error then goto EXIT_DOOR$$ say := write SYS$OUTPUT$ bell[0,8] = 7$ outfile = ""$ $ image = p1$ show_exe = 1$$ if p2 .nes. "" then show_exe = 0$ $GET_IMAGE:@$ if image .eqs. "" then inquire /nopunct image "Image name? "2$ image = f$edit (image,"TRIM,COMPRESS,UNCOMMENT")*$ if image .eqs. "" then goto GET_IMAGE$8$ image_string = "SYS$SYSTEM:''image'" - ".EXE" + ".EXE"&$ full_image = f$search (image_string)$ if full_image .eqs. ""$ then;$ image_string = "SYS$LIBRARY:''image'" - ".EXE" + ".EXE"($ full_image = f$search (image_string)$ endif$ if full_image .eqs. ""$ then*$ image_string = image - ".EXE" + ".EXE"($ full_image = f$search (image_string)$ endif$$ if full_image .eqs. ""$ then3$ say "%Error: could not find image file." + bell$ else=$ outfile := SYS$SCRATCH:ai_search_'f$getjpi("","PID")'.tmp$ first_image = full_image$ blank = show_exe$LOOP:$ if show_exe$ then$ say full_image $ say "" $ endif $ set noon$ define /user SYS$ERROR NL:$ define /user SYS$OUTPUT NL:.$ analyze /image 'full_image' /out='outfile'$$ zip = blank + 2 - (show_exe * 2)A$ search 'outfile' "image name", "image file identification", -> "link date/time", "linker identification" /nohighlight$ delete /nolog 'outfile';* $ set on $ blank = 1($ full_image = f$search (image_string)F$ go_go = (full_image .nes. "") .and. (full_image .nes. first_image))$ if go_go .and. show_exe then say ""$ if go_go then goto LOOP$ endif$ $EXIT_DOOR:A$ if f$search (outfile) .nes. "" then delete /nolog 'outfile';*'$ if verflg then EXIT f$verify(1) + 1$ EXIT 1*[JONATHAN.UNITOOLS]CM.COM;19+,. /( 4P r-0123KPWO56$71Wv89L wG(HJ K$! Command procedure to examine and (optionally) update the NEWMAIL counter$! for a VAX MAIL user.$!$! Author: Jonathan Ridler.$!$! Use as follows:+$! $ cm :== @disk:[directory]this_file.com%$! $ cm [ Username [ Update_Count ]]$!D$! If no username is specified, the current user's username is used.B$! Without an Update_Count the current NEWMAIL count is displayed.N$! With an Update_Count the current NEWMAIL count may _optionally_ be changed.P$! (To update the current user's NEWMAIL count, specify the username explicitly)$F$ if .not. f$privilege("SYSPRV") then exit (10548) ! SS$_NOSECURITY.5$ if p1 .eqs. "" then p1 = f$getjpi ("","USERNAME")$ p1 = f$edit (p1,"COLLAPSE")$ lock = "/nolock"$ if p2 .nes. ""$ then$ p2 = f$edit (p2,"COLLAPSE")$ lock = "/lock"$ endif$ say := write SYS$OUTPUT$$ on error then goto ENDK$ open /share=write /read /write Mailfile VMSMAIL_PROFILE ! Use logical.E$ read /index=0 /key="''p1'" /error=NO_REC 'lock' Mailfile User_RecA$ new_cnt = f$cvui (35*8,16,User_Rec) ! Determine NEWMAIL count.$ if new_cnt .eq. 0$ then)$ say "''p1' has no new MAIL messages."$ else=$ say f$fao ("!AS has !SL new MAIL message!%S.",p1,new_cnt)$ endif$$ if p2 .nes. ""$ then"$ if f$type (p2) .eqs. "INTEGER"$ then$ p2i = f$integer (p2)+$ if (p2i .lt. 0) .or. (p2i .gt. 32000) $ then9$ say "Invalid integer replacement NEW MAIL count." $ else$ inquire /nopunct ans -F "Change NEW MAIL count for ''p1' from ''new_cnt' to ''p2'? [No]: "$ ans = f$edit (ans,"COLLAPSE")#$ if ans .eqs. "" then ans = "NO"$ if ans $ then2$ User_Rec[35*8,16] = p2i ! Update field.=$ write /update Mailfile User_Rec ! Replace record.4$ say "NEW MAIL count for ''p1' updated to ''p2'."$ else,$ say "MAIL record for ''p1' NOT updated." $ endif $ endif$ elseA$ say "Invalid replacement NEW MAIL count - must be integer." $ endif$ endif$ $ goto END$$NO_REC:!$ say "No MAIL record for ''p1'."$$END:$ close Mailfile$ EXIT#*[JONATHAN.UNITOOLS]DECW_TITLE.COM;1+,. /( 40 -0123KPWO568h7rov89L wG(HJ$ verflg = 'f$verify(0)'$/$ title = p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8$$ OSC[0,8] = 157$ ST[0,8] = 1560$ say OSC,"2L;''title'",ST, OSC,"21;''title'",ST$$ EXIT 1 + 0 * f$verify(verflg)*[JONATHAN.UNITOOLS]DTU.COM;6+,. /( 4B -0123KPWO563u1\w7=\w89G(HJ$ v = 'f$verify (0)')$! Login on a DECterm as the given user.$ $ set noon$ set nocontrol$ say := write SYS$OUTPUTB$ ask := read SYS$COMMAND /end=EXIT_DOOR /error=EXIT_DOOR /prompt=)$ su := $SYS_SYSTEM:JUMP /SETUSER /NOLOG$ xw := @SYS_SYSTEM:XW!$ me = f$getjpi ("","USERNAME")$.$ display = f$getdvi ("DECW$DISPLAY","DEVNAM"))$ if .not. $status then goto EXIT_DOOR$ $GET_USER:+$ if p1 .eqs. "" then ask "Username? " p1.$ p1 = f$edit (p1,"COLLAPSE,UPCASE,UNCOMMENT")&$ if p1 .eqs. "" then goto GET_USER$$ set uic 'p1')$ if .not. $status then goto EXIT_DOOR $ su 'p1'$ xw dectermn 'p2' 'p3'$ set uic 'me' $ su 'me'$ $EXIT_DOOR: $ set control$ EXIT 1 + 0 * f$verify (v)*[JONATHAN.UNITOOLS]G.COM;21+,./( 4P t-0123KPWO 56NG7%v89L wG(HJ$ verify = 'f$verify(0)'P$!------------------------------------------------------------------------------ $! G . C O M $! =========$!K$! This DCL command procedure textually searches output from DCL commands,L$! specifically SHOW commands, but also other commands that produce output.I$! The DCL command and the consequent SEARCH command may both optionally$! have qualifiers.$!*$! Usage: $ @g P1 P2 [P3] [P4] [P5]J$! where P1 = a valid DCL SHOW command option (e.g. LOGICAL or SYMBOL);@$! P1 may be prepended with a "#" to indicate that the commandB$! is standalone (i.e. does not require "SHOW" to be used) OR@$! P1 may be prepended with a "^" to indicate that the command1$! does not support the /OUTPUT qualifier OR;$! P1 may be prepended with a "=" to indicate the same as4$! prepending the command with both "#" and "^".$! C$! P2 = translation text(s) to be found (comma-separated list);P$! P3 = qualifiers and/or parameters for SHOW (or other ("#")) command;/$! P4 = qualifiers for SEARCH command;J$! P5 = optional - if present, do not delete output from command.$!L$! Various commands are handled specifically in this procedure according toM$! their syntactic ability to use the /OUTPUT qualifier, and if they are notM$! SHOW commands. For some specific non-SHOW commands, the "#" is optional.$!$! Example usage:,$! $ glnm :== @disk:[directory]G LOGICAL+$! $ gsym :== @disk:[directory]G SYMBOL$!*$! $ glnm my_fancy_logical_translation0$! "FRED" = "MY_FANCY_LOGICAL_TRANSLATION"E$! "JACK" = "INCLUDED_HERE_IS_MY_FANCY_LOGICAL_TRANSLATION_TOO".$! $ glnm TRANS1,TRANS2,".JAZZY]" /table=*$! "JAZZ" = "D_J:[BOPP.JAZZY]"#$! "JILL" = "SEE_TRANS1_ONLY"($! "JOAN" = "SEE_TRANS2_ONLY_HERE"$! $ glnm concealed /full>$! "DISK$SYS_0" [exec] = "$1$DUS0:" [concealed,terminal]?$! "DISK$SYS_1" [exec] = "$1$DUS10:" [concealed,terminal]$!$! $ gsym sd$! POTSDAM == "@SYS$LOGIN:ZOT"$! SD == "$SYS_SYSTEM:SD"$! ZOT == "@SYS$LOGIN:POTSDAM"$!*$! $ @g "#ncp show known nodes" mynodeL$! 42.12 (MYNODE) reachable 4 0 MNA-0 42.12 (MYNODE)$!%$! $ @g "sysgen show /all" shadowJ$! SHADOWING 3 0 0 3 Coded-valuG$! SHADOW_SYS_DISK 0 0 0 1 BooleanD$! SHADOW_SYS_UNIT 0 0 0 9999 UnitL$! SHADOW_MAX_COPY 3 4 0 42 Threads DL$! SHADOW_MBR_TMO 20 20 0 65535 Seconds D$!$! Author: Jonathan Ridler,($! Information Technology Services,$$! The University of Melbourne.$!$! Date: 10-Nov-1992.P$!------------------------------------------------------------------------------$"$ on warning then goto ESCAPE"$ on control_y then goto ESCAPE$$ say := write SYS$OUTPUT<$ ask := read SYS$COMMAND /error=ESCAPE /end=ESCAPE /prompt=$ Pid = f$getjpi ("","PID")$ Fyl = "G_''PID'.TMP"$ output_ok = 1$ use_show = 1$ delete_fyl = 1$$GET_P1:4$ if p1 .eqs. "" then ask "Show (or do) what? " p1$$ if p1 .eqs. "" then goto GET_P1$$ p1 = f$edit (p1,"UPCASE,COMPRESS")$$GET_P2:4$ if p2 .eqs. "" then ask "String(s) to find? " p2$$ if p2 .eqs. "" then goto GET_P2$&$ if p5 .nes. "" then delete_fyl = 0$$ a1 = f$extract (0,1,p1)$ a2 = f$extract (0,2,p1)$ a3 = f$extract (0,3,p1)$ a4 = f$extract (0,4,p1)&$ if a1 .eqs. "#" then p1 = p1 - "#"&$ if a1 .eqs. "=" then p1 = p1 - "="<$ if (a1 .eqs. "#") .or. (a1 .eqs. "=") then use_show = 0'$ if a1 .eqs. "=" then output_ok = 0$=$ if a2 .eqs. "SH" then use_show = 0 ! Fudge it for SH*OW.$($ if p1 .eqs. "ACL" then output_ok = 0$ if p1 .eqs. "KEY"$ then$ output_ok = 0$ p1 = "KEY /ALL "$ endif0$ if p1 .eqs. "LOGICAL" then p1 = "LOGICAL * "$ if p1 .eqs. "SYMBOL"$ then$ output_ok = 0$ p1 = "SYMBOL /ALL /GLOBAL "$ endif$?$ if a2 .eqs. "AN" then use_show = 0 ! Some form of ANALYZE.$$ if a3 .eqs. "NCP" ! NCP.$ then$ output_ok = 0$ use_show = 0$ endif$)$ if (a4 .eqs. "SYSG") .or. - ! SYSGEN or, (a4 .eqs. "AUTH") .or. - ! AUTHORIZE or@ (a4 .eqs. "MCR ") ! MCR something - make assumptions about$$ then ! the MCR target program.$ output_ok = 0$ use_show = 0$ endif$$! Do the DCL command.$$ if output_ok$ then$ if use_show$ then"$ show 'p1' /output='Fyl' 'p3'$ else"$ 'p1' /output='Fyl' 'p3' $ endif$ else$ define SYS$OUTPUT 'Fyl'$ if use_show$ then$ show 'p1' 'p3'$ else$ 'p1' 'p3' $ endif$ deassign SYS$OUTPUT$ endif$$ search 'Fyl' 'p2' 'p4'$$ESCAPE: $ set noon$ if delete_fyl$ then;$ if f$search (Fyl) .nes. "" then delete /nolog 'Fyl';*$ else>$ say "%Output from command remains in file ''f$parse(Fyl)'"$ endifA$ if f$trnlnm ("SYS$OUTPUT") .eqs. Fyl then deassign SYS$OUTPUT$ set on$ $ EXIT 1 + 0 * f$verify (verify)*[JONATHAN.UNITOOLS]GBL.COM;6+,. /( 4- -0123KPWO56栗7xv89L wG(HJ$ v = 'f$verify (0)'"$ gpf = f$getsyi ("free_gblpages")$ gpt = f$getsyi ("gblpages")$ gpu = gpt - gpf"$ gsf = f$getsyi ("free_gblsects") $ gst = f$getsyi ("gblsections")$ gsu = gst - gsf($ say "Global Resource Free Used Total"($ say "--------------- ---- ---- -----"*$ say "Global Pages ''gpf' ''gpu' ''gpt'"-$ say "Global Sections ''gsf' ''gsu' ''gst'"$$ EXIT 1 + 0 * f$verify (v)*[JONATHAN.UNITOOLS]REX.COM;7+,. /( 4M J-0123KPWO56cld7 v89L wG(HJ$ verify = 'f$verify(0)'M$! REX.COM Count records in file(s). Can use wildcards & lists in filespec.$6$ ask := read SYS$COMMAND /error=END /end=END /prompt=$$START:*$ if p1 .eqs. "" then ask "File(s)? " p1#$ if p1 .eqs. "" then goto START$$ copy /log 'p1' NL:$$$END: EXIT 1 + 0 * f$verify (verify)*[JONATHAN.UNITOOLS]WS.COM;3+,. /( 4O -0123KPWO56N7fyPv89L wG(HJ$ verflg = 'f$verify(0)'$! Working Set Information.$ $ pid = "" $ ctx = ""$$ say -" Working Set Information"$ say ""$ say -*" WS WS WS WS Pages Page"$ say -O"Username Processname State Extnt Quota Deflt Size in WS faults Image"$ say ""$ $ if p1 .nes. "" then pid = p1$START:)$ if p1 .eqs. "" then pid = f$pid (ctx)"$ if pid .eqs. "" then goto END+$ username = f$getjpi ("''pid'","USERNAME"))$ if username .eqs. "" then goto START($ Procnam = f$getjpi ("''pid'","PRCNAM")<$ imgnam = f$parse (f$getjpi ("''pid'","IMAGNAME"),,,"NAME")&$ state = f$getjpi ("''pid'","STATE")($ wsdef = f$getjpi ("''PID'","DFWSCNT"))$ wsquota = f$getjpi ("''pid'","WSQUOTA")+$ wsextent = f$getjpi ("''pid'","WSEXTENT")'$ wssize = f$getjpi ("''pid'","WSSIZE")($ glbpags = f$getjpi ("''pid'","GPGCNT"))$ procpags = f$getjpi ("''pid'","PPGCNT")*$ pagflts = f$getjpi ("''pid'","PAGEFLTS")$ pages = glbpags + procpags$,$ say f$fao ("!AS!15AS!5AS!5(6SL)!7SL!AS", -2 username,procnam,state,wsextent,wsquota,wsdef, -" wssize,pages,pagflts," "+imgnam)#$ if p1 .eqs. "" then goto START$ .$END: if verflg then $ EXIT f$verify(1) + 1$ EXIT 1*[JONATHAN.UNITOOLS]XW.COM;3+,./( 4P "-0123KPWO 56*K7fvv89L wG(HJ$ verify = 'f$verify(0)'P$!------------------------------------------------------------------------------$! X W . C O M$!K$! From a VMS DECwindows workstation, run a DECwindows application program$! on a remote node.$!$! Assumptions:G$! - For execution on a remote server from a VAXstation, the user has a3$! proxy login enabled on the remote server node.@$! - By default, the image to be executed has a name of the formI$! SYS$SYSTEM:DECW$xx.EXE where "xx" is the image identification passed:$! to this procedure (e.g. CALENDAR, PAINT, CALC, etc.).J$! - Because of a 12 character limit to the length of the string passed toI$! the DECNET TASK object, the image name (or image pseudonym) can haveJ$! a maximum length of 10 characters or less, depending on the length of@$! the name of the NCP TASK which executes this DCL procedure.G$! If no NCP TASK is defined, then the length of the parameter to the-$! task will be (11 - length_of_proc_name).D$! For example, if this procedure is in a file called DWR.COM, the2$! maximum image identification is 8 characters.D$! - For a non-DECnet invocation, the image/command parameter has no"$! imposed minimum length limit.$! $! Usage: @XW p1 [p2] [p3] [p4]E$! where p1 is an image identification / command string; (required)9$! p2 is a client on which to display; (optional)0$! p3 is a server on which to run; (optional)I$! p4 is a parameter/qualifier set for the SET DISPLAY cmd. (optional)$! $! Examples:9$! - To run the DECwindows calculator on node BIGVAX from2$! a VMS VAXstation, do $ @XW CALC "" BIGVAXI$! - To run the DECwindows bookreader to display on node 128.250.9.9 fromI$! a telnet session on a VAXcluster node, do $ @ XW BOOK 128.250.9.9$!P$!------------------------------------------------------------------------------O$! Author: Jonathan Ridler (with thanks to Chris Chaundy for some ideas here).'$! Information Technology Services,#$! The University of Melbourne.$!$! Date: 12-Jun-1991. $! Modified:P$!------------------------------------------------------------------------------$$ on error then goto END$ say := write SYS$OUTPUT$$$ network = f$mode() .eqs. "NETWORK"!$ node = f$getsyi ("NODENAME"),$ remote = f$trnlnm ("SYS$REM_NODE") - "::"%$ display = f$trnlnm ("DECW$DISPLAY")M$ VAXstation = (f$getsyi ("WINDOW_SYSTEM") .eq. 1) .and. (display .nes. "")$ temp_display = 0$$ screen = 0 ! default$ xport = "TCPIP" ! default$ $ cmd = p1 $ client = p2 $ server = p3 $ if network$ then$ client = remote$ xport = "DECNET"$ endif$;$ if .not. network ! ... then it's the initiating process.$ then!$ on control_y then goto END$ set control = (Y,T)$$ if cmd .eqs. ""$ thenM$ say "%XW-ERROR, A DECwindows application or command must be specified."$ goto END $ endif$K$ if f$locate (".",client) .eq. f$length (client) then xport = "DECNET"$$ if VAXstation$ then/$ if client .eqs. "" then client = node2$ if client .eqs. node then xport = "LOCAL"7$ if server .nes. "" ! Fire it off, then terminate. $ then$ if client .eqs. node$ then)$ open net1 'server'::"task=XW ''cmd'"$ close net1$ elseJ$ say "%XW-ERROR, Execution and display not on client is not supported."$ endif:$ goto END ! End of VAXstation initiation of application $ endif8$ else ! It's something other than a VMS VAXstation.$ if client .eqs. "" $ then$ if remote .nes. ""$ then$ client = remote$ elseH$ say "%XW-ERROR, A remote node name on which to display is required." $ goto END$ endif $ endif$$ colon = f$locate (":",client))$ client = f$extract (0,colon,client)B$ screen = f$extract (colon+1,f$length(client)-colon-1,client)*$ if screen .eqs. "" then screen = 0 $ endif$ endif$$! Run application:=$! Make it easier to use standard DECwindows applications ...$/$ if cmd .eqs. "BOOK" then cmd = "BOOKREADER".$ if cmd .eqs. "CARD" then cmd = "CARDFILER"$$$ if (cmd .eqs. "BOOKREADER") .or. - (cmd .eqs. "CALC") .or. -" (cmd .eqs. "CALENDAR") .or. -# (cmd .eqs. "CARDFILER") .or. - (cmd .eqs. "CLOCK") .or. - (cmd .eqs. "MAIL") .or. -! (cmd .eqs. "NOTEPAD") .or. - (cmd .eqs. "PAINT") .or. -C (cmd .eqs. "PUZZLE") then cmd = "run SYS$SYSTEM:DECW$''cmd'"$@$! Include pseudonym handling for non-standard commands here ...$P$ if cmd .eqs. "DECTERM" then cmd = "create /terminal=decterm /detach /nologg"H$ if cmd .eqs. "DECTERMN" then cmd = "create /terminal=decterm /detach"F$ if cmd .eqs. "DECTERMP" then cmd = "create /terminal=decterm /wait"$ if cmd .eqs. "EVE" then -? cmd = "edit /tpu /display=decwindows /section=TPU$SECTION":$ if (cmd .eqs. "FILEVIEW") .or. (cmd .eqs. "VUE") then -& cmd = "run SYS$SYSTEM:VUE$MASTER":$ if cmd .eqs. "VIEW" then cmd = "view /select=x_display"$"$ if cmd .eqs. "" then goto END$ $ if network$ then#$ open net2 /read /write SYS$NET$ close net2$ endif$K$! If the display doesn't already exist, create it ... then do the command!$0$ if (display .eqs. "") .or. (client .nes. node)$ thenO$ set display /create /node='client' /screen='screen' /transport='xport' 'p4'$ temp_display = 1$ endif$$ 'cmd'$$END:,$ if temp_display then set display /delete$ if network then EOJ$)$ if verify then $ EXIT f$verify(1) + 1$ EXIT 1*[JONATHAN.UNITOOLS]Z.COM;28+,. /( 4P -0123KPWO56eI>7v89L wG(HJP$! Command procedure to continuously SHOW something (assume VT100-type display).?$! Exit with CONTROL_C, CONTROL_Y, CONTROL-Z, or if any errors.$!=$! Press RETURN at any time to completely refresh the screen.$!N$! P1 = option for SHOW command (required), or if first character is "#" thenO$! the command is not a show command. If the first character is "_" then=$! disable error handling for the command and check for "#".J$! P2 = optional time between updates (in seconds); default is 5 seconds./$! P3 = optional display formatting character:>$! if absent (default), home cursor before each re-display;K$! if a "C" (for "Continue"), print a blank line before each re-display;I$! if any other character, always clear screen before each re-display.$$ esc[0,8] = 27$ home = esc + "[H"$ clear = home + esc + "[J"$ use_show = 1$ no_fail = 0$$ say := write SYS$OUTPUT9$ ask := read SYS$COMMAND /error=DONE /end=DONE /prompt=?$ ask2 := read SYS$COMMAND /error=SKIP /end=DONE /prompt=""""""$ $ on control_y then goto DONE$ASK_IT:,$ if p1 .eqs. "" then ask "Show what? " p1$$ if p1 .eqs. "" then goto ASK_IT)$ p1 = f$edit (p1,"COMPRESS,TRIM,UPCASE")$GET_IT:$ a1 = f$extract (0,1,p1)$ a2 = f$extract (0,2,p1)$ if a1 .eqs. "_"$ then$ p1 = p1 - "_"$ no_fail = 1$ goto GET_IT$ endif$ if a1 .eqs. "#"$ then$ p1 = p1 - "#"$ use_show = 0$ endif=$ if a2 .eqs. "SH" then use_show = 0 ! Fudge it for SH*OW.$$ if p2 .le. 1 then p2 = 5$ if p2 .gt. 60 then p2 = 60$$ zot = "home"&$ if p3 .nes. "" then zot = "clear"%$ if p3 .eqs. "C" then zot = """""" $ say clear$$LOOP:$ on warning then goto DONE$ if no_fail then set noon $ if use_show$ then $ show 'p1'$ else$ 'p1'$ endif$ if no_fail then set on$ ask2 /timeout='p2' junk $ say clear$SKIP: $ say 'zot' $ goto LOOP$$DONE:$ EXIT 1p ݙ?~ UNITOOLS.BCKu([JONATHAN.UNITOOLS]FREEWARE_README.TXT;1P 5(*[JONATHAN.UNITOOLS]FREEWARE_README.TXT;1+,u. /( 4P -0123KPWO56 8w7ʌ8w89G(HJ.UNITOOLS, TOOLS, Various useful DCL proceduresUniversity Tools----------------OThis miscellany of DCL command procedures provides a number of useful tools foreveryday usage.; ACC_DEL - Selectively delete OpenVMS accounting records.8 AI - Display image creation data from ANALYZE/IMAGE.' CM - Display/change newmail counts.3 DECW_TITLE - Set DECterm window and icon titles.4 DTU - Start a DECterm logged in as another user.< G - Search for specific text in output from any command.> GBL - Display summary of Global Pages and Global Sections.! REX - Count records in files.; WS - Display working set information for all processes.1 XW - Run an X11 program on a given X-display.; Z - Interactively repeat a command at a given interval.PThey are provided AS IS and UNSUPPORTED. Some may use simple symbol definitions6which are assumed (e.g., $ say :== write SYS$OUTPUT).(Comments, improvements, etc are welcome.P--------------------------------------------------------------------------------LJonathan Ridler (VMS Systems Manager) Information Technology Services,HTelephone: +61 3 9344 7994 The University of Melbourne,CFax: +61 3 9347 4803 Thomas Cherry Building,MEmail: jonathan@unimelb.edu.au Parkville, Vic., AUSTRALIA, 3052.P--------------------------------------------------------------------------------)*[JONATHAN.UNITOOLS]FREEWARE_RELEASE.TXT;1+,. /( 4P -0123KPWO56v7'}ew89G(HJFreeware Developer Release Form-------------------------------KAs the owner/developer of this software, I release it to be included on theMOpenVMS Freeware CD-ROM. I expect no remunerances or payments for the use of2this software from Digital or Digital's customers.Jonathan Ridler.P--------------------------------------------------------------------------------LJonathan Ridler (VMS Systems Manager) Information Technology Services,HTelephone: +61 3 9344 7994 The University of Melbourne,CFax: +61 3 9347 4803 Thomas Cherry Building,MEmail: jonathan@unimelb.edu.au Parkville, Vic., AUSTRALIA, 3052.P--------------------------------------------------------------------------------pz$u([JONATHAN.UNITOOLS]FREEWARE_README.TXT;1P B$+`ljTMO } wk|ioo~MLx.CAM/A#JKNoTAAN $ (( 4PxwV6.2 _RUDEcS* 0 nDSA30e6.2K~^ W|O56 8w6!c8A\HyN.UNITOOL[]xCC_DEL.COI;v4**NI. )( 4P. UNIQOMS, TOOLS, Various ssHf|'DCL"pBocfuCes2UnmvVrsity"T$o }--,-z--)-b-+---zUhasmpnq XfvmeaVd proceduzeJ #`s$agn]mcep 'fqe,u_tekls foseveradEYV= ']$VER(%:wtlkY-rHAHNYD[HAT IHAHYH b]HC{`~ LNNBXCYDCJ _HNB_I^-- ld$$ iD^]ALT D@LJH N_HLYDBa @@TAa%10)e `ZG/mloGa sPL*9)fKFd&74|C  N  ALO \d@." eXCs~ti91aBRiETj++" %   aFdHjONTI=\mUtIONd0jaCO? TsR2, ^I HNnGEDI:HSuT S qeLBO2{gHQeESohGORh SG PDqED!CXEIL@),7=doI M ]WoNGfm8  ]]X@z?(?h&NFM(B1 N Gg  I0@E.!)({$zY|$1r{  A  AnnUMB2!)jBN"WpwKSFDCJ ^HY DCKB_@LYDBC KB_ LAA ]_BNH^^H^-- uz$$ XC LC u ]_BJ_L@ BC L JD[dnXdMSAOrUiNGz))YH,TEIV ?:a" ReETOTHVE OTE7%"-~EtMhAYS EMRDst1;0 iNwu1#$rnxd\EA7O>!.V+i  :!jKnitL&+*>[WGlFC4CCOUNTINGQUAL9SLG PdMc Psunt4e)-(X@ UCl~hnb`}h~~ - DK ] H\^  YEHC JBYB jhyr},- -'- jhyrlc~- L^F {LAate this selection? (Yes/No) " ans&$ ans = f$edit (ans,"UPCASE,COMPRESS")'$ if ans /fqs. "" then !fFtE { ~.qNmt&)l}3)&ke6/!e&-)+as"A 7tvGTtAOQ7,$%$!sey",RunjiAgabcOuZtkl7 to)valkdte selection ..."$$ dvnne -uCerqyB$inquF s}scommaldR_`c3ouotw/fql# $p1'"'E2%* SckoBnNn(cWmpleted."  $GET_AJSv:% cs# qejts selectikj? (Yer/No) " ~n5rCeSA SdXVH  zMQ0p.!(,\O`}h~~ - DK LC^ H\^  YEen kg.OTH"e;(/+!dGvALE\NT SARCT&R >T!iP @oBANAI' I  o8n; v9<# ES&(H1;$ANgKZOeGTA O UASJ PBTG UTRAoGt+SHEPAUArMmdTCIa O1LUNCJ."nO HCLRMD r%HYLDCHI _HNB_I^ L_H DC KDAH _HGrKTA -- ^LT hUY_LNYHI _HNB_I^ L_H DC KDA) mH7LuKddeV[74sqxsPegs $:>&+! AS"ND,TNHE>:HLYtCQVCM*I;/ EERH: PN@RESPMANS upcase comp-6swGNvARTNF(LOWPNEX+e(AX]OTOgettws 3IRQ]STHENCOPYLO3HH% UR^PsRhl@idgGT,/:_ jKNAL LK\YFILESyES[KTI ,VMCOBSahs2v$( 5 R^F UCl~hnb`}h~~ - DK LC^ H\^  YEHC JBYB jhyrlc~-- DK LC^ YEHC IHAHYH /log 'rej_fyl';*,'out_fyl';*$$ESCAPE: $EXIT_DOOR: $ EXIT 1 + 0 * f$verify (verify)*[JONATHAN.UNITOOLS]AI.COM;43+,. /( 4P hp-0123KPWO56t@ 7Q)>v89L wG(HJ $ verflg = 'f$verify(0)'P$!------------------------------------------------------------------------------M$! AI.COM Do an Analyze /Image and return the image identification section"$! of the specified image(s).$!$! Usage: @AI [[p1] [p2]]0$! where p1 = image name (can have wildcards).@$! p2 = anything - if present, do NOT display executable$! filename.$!$! Author: Jonathan RIDLER,$$! Information Technology Services, $! The University of Melbourne.$! Date: 15-Aug-1991.P$!------------------------------------------------------------------------------$$ set control=(Y,T)%$ on control_y then goto EXIT_DOOR%$ on error then goto EXIT_DOOR$$ say := write SYS$OUTPUT$ bell[0,8] = 7$ outfile = ""$ $ image = p1$ show_exe = 1$$ if p2 .nes. "" then show_exe = 0$ $GET_IMAGE:@$ if image .eqs. "" then inquire /nopunct image "Image name? "2$ image = f$edit (image,"TRIM,COMPRESS,UNCOMMENT")*$ if image .eqs. "" then goto GET_IMAGE$8$ image_string = "SYS$SYSTEM:''image'" - ".EXE" + ".EXE"&$ full_image = f$search (image_string)$ if full_image .eqs. ""$ then;$ image_string = "SYS$LIBRARY:''image'" - ".EXE" + ".EXE"($ full_image = f$search (image_string)$ endif$ if full_image .eqs. ""$ then*$ image_string = image - ".EXE" + ".EXE"($ full_image = f$search (image_string)$ endif$$ if full_image .eqs. ""$ then3$ say "%Error: could not find image file." + bell$ else=$ outfile := SYS$SCRATCH:ai_search_'f$getjpi("","PID")'.tmp$ first_image = full_image$ blank = show_exe$LOOP:$ if show_exe$ then$ say full_image $ say "" $ endif $ set noon$ define /user SYS$ERROR NL:$ define /user SYS$OUTPUT NL:.$ analyze /image 'full_image' /out='outfile'$$ zip = blank + 2 - (show_exe * 2)A$ search 'outfile' "image name", "image file identification", -> "link date/time", "linker identification" /nohighlight$ delete /nolog 'outfile';* $ set on $ blank = 1($ full_image = f$search (image_string)F$ go_go = (full_image .nes. "") .and. (full_image .nes. first_image))$ if go_go .and. show_exe then say ""$ if go_go then goto LOOP$ endif$ $EXIT_DOOR:A$ if f$search (outfile) .nes. "" then delete /nolog 'outfile';*'$ if verflg then EXIT f$verify(1) + 1$ EXIT 1*[JONATHAN.UNITOOLS]CM.COM;19+,. /( 4P r-0123KPWO56$71Wv89L wG(HJ K$! Command procedure to examine and (optionally) update the NEWMAIL counter$! for a VAX MAIL user.$!$! Author: Jonathan Ridler.$!$! Use as follows:+$! $ cm :== @disk:[directory]this_file.com%$! $ cm [ Username [ Update_Count ]]$!D$! If no username is specified, the current user's username is used.B$! Without an Update_Count the current NEWMAIL count is displayed.N$! With an Update_Count the current NEWMAIL count may _optionally_ be changed.P$! (To update the current user's NEWMAIL count, specify the username explicitly)$F$ if .not. f$privilege("SYSPRV") then exit (10548) ! SS$_NOSECURITY.5$ if p1 .eqs. "" then p1 = f$getjpi ("","USERNAME")$ p1 = f$edit (p1,"COLLAPSE")$ lock = "/nolock"$ if p2 .nes. ""$ then$ p2 = f$edit (p2,"COLLAPSE")$ lock = "/lock"$ endif$ say := write SYS$OUTPUT$$ on error then goto ENDK$ open /share=write /read /write Mailfile VMSMAIL_PROFILE ! Use logical.E$ read /index=0 /key="''p1'" /error=NO_REC 'lock' Mailfile User_RecA$ new_cnt = f$cvui (35*8,16,User_Rec) ! Determine NEWMAIL count.$ if new_cnt .eq. 0$ then)$ say "''p1' has no new MAIL messages."$ else=$ say f$fao ("!AS has !SL new MAIL message!%S.",p1,new_cnt)$ endif$$ if p2 .nes. ""$ then"$ if f$type (p2) .eqs. "INTEGER"$ then$ p2i = f$integer (p2)+$ if (p2i .lt. 0) .or. (p2i .gt. 32000) $ then9$ say "Invalid integer replacement NEW MAIL count." $ else$ inquire /nopunct ans -F "Change NEW MAIL count for ''p1' from ''new_cnt' to ''p2'? [No]: "$ ans = f$edit (ans,"COLLAPSE")#$ if ans .eqs. "" then ans = "NO"$ if ans $ then2$ User_Rec[35*8,16] = p2i ! Update field.=$ write /update Mailfile User_Rec ! Replace record.4$ say "NEW MAIL count for ''p1' updated to ''p2'."$ else,$ say "MAIL record for ''p1' NOT updated." $ endif $ endif$ elseA$ say "Invalid replacement NEW MAIL count - must be integer." $ endif$ endif$ $ goto END$$NO_REC:!$ say "No MAIL record for ''p1'."$$END:$ close Mailfile$ EXIT#*[JONATHAN.UNITOOLS]DECW_TITLE.COM;1+,. /( 40 -0123KPWO568h7rov89L wG(HJ$ verflg = 'f$verify(0)'$/$ title = p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8$$ OSC[0,8] = 157$ ST[0,8] = 1560$ say OSC,"2L;''title'",ST, OSC,"21;''title'",ST$$ EXIT 1 + 0 * f$verify(verflg)*[JONATHAN.UNITOOLS]DTU.COM;6+,. /( 4B -0123KPWO563u1\w7=\w89G(HJ$ v = 'f$verify (0)')$! Login on a DECterm as the given user.$ $ set noon$ set nocontrol$ say := write SYS$OUTPUTB$ ask := read SYS$COMMAND /end=EXIT_DOOR /error=EXIT_DOOR /prompt=)$ su := $SYS_SYSTEM:JUMP /SETUSER /NOLOG$ xw := @SYS_SYSTEM:XW!$ me = f$getjpi ("","USERNAME")$.$ display = f$getdvi ("DECW$DISPLAY","DEVNAM"))$ if .not. $status then goto EXIT_DOOR$ $GET_USER:+$ if p1 .eqs. "" then ask "Username? " p1.$ p1 = f$edit (p1,"COLLAPSE,UPCASE,UNCOMMENT")&$ if p1 .eqs. "" then goto GET_USER$$ set uic 'p1')$ if .not. $status then goto EXIT_DOOR $ su 'p1'$ xw dectermn 'p2' 'p3'$ set uic 'me' $ su 'me'$ $EXIT_DOOR: $ set control$ EXIT 1 + 0 * f$verify (v)*[JONATHAN.UNITOOLS]G.COM;21+,./( 4P t-0123KPWO 56NG7%v89L wG(HJ$ verify = 'f$verify(0)'P$!------------------------------------------------------------------------------ $! G . C O M $! =========$!K$! This DCL command procedure textually searches output from DCL commands,L$! specifically SHOW commands, but also other commands that produce output.I$! The DCL command and the consequent SEARCH command may both optionally$! have qualifiers.$!*$! Usage: $ @g P1 P2 [P3] [P4] [P5]J$! where P1 = a valid DCL SHOW command option (e.g. LOGICAL or SYMBOL);@$! P1 may be prepended with a "#" to indicate that the commandB$! is standalone (i.e. does not require "SHOW" to be used) OR@$! P1 may be prepended with a "^" to indicate that the command1$! does not support the /OUTPUT qualifier OR;$! P1 may be prepended with a "=" to indicate the same as4$! prepending the command with both "#" and "^".$! C$! P2 = translation text(s) to be found (comma-separated list);P$! P3 = qualifiers and/or parameters for SHOW (or other ("#")) command;/$! P4 = qualifiers for SEARCH command;J$! P5 = optional - if present, do not delete output from command.$!L$! Various commands are handled specifically in this procedure according toM$! their syntactic ability to use the /OUTPUT qualifier, and if they are notM$! SHOW commands. For some specific non-SHOW commands, the "#" is optional.$!$! Example usage:,$! $ glnm :== @disk:[directory]G LOGICAL+$! $ gsym :== @disk:[directory]G SYMBOL$!*$! $ glnm my_fancy_logical_translation0$! "FRED" = "MY_FANCY_LOGICAL_TRANSLATION"E$! "JACK" = "INCLUDED_HERE_IS_MY_FANCY_LOGICAL_TRANSLATION_TOO".$! $ glnm TRANS1,TRANS2,".JAZZY]" /table=*$! "JAZZ" = "D_J:[BOPP.JAZZY]"#$! "JILL" = "SEE_TRANS1_ONLY"($! "JOAN" = "SEE_TRANS2_ONLY_HERE"$! $ glnm concealed /full>$! "DISK$SYS_0" [exec] = "$1$DUS0:" [concealed,terminal]?$! "DISK$SYS_1" [exec] = "$1$DUS10:" [concealed,terminal]$!$! $ gsym sd$! POTSDAM == "@SYS$LOGIN:ZOT"$! SD == "$SYS_SYSTEM:SD"$! ZOT == "@SYS$LOGIN:POTSDAM"$!*$! $ @g "#ncp show known nodes" mynodeL$! 42.12 (MYNODE) reachable 4 0 MNA-0 42.12 (MYNODE)$!%$! $ @g "sysgen show /all" shadowJ$! SHADOWING 3 0 0 3 Coded-valuG$! SHADOW_SYS_DISK 0 0 0 1 BooleanD$! SHADOW_SYS_UNIT 0 0 0 9999 UnitL$! SHADOW_MAX_COPY 3 4 0 42 Threads DL$! SHADOW_MBR_TMO 20 20 0 65535 Seconds D$!$! Author: Jonathan Ridler,($! Information Technology Services,$$! The University of Melbourne.$!$! Date: 10-Nov-1992.P$!------------------------------------------------------------------------------$"$ on warning then goto ESCAPE"$ on control_y then goto ESCAPE$$ say := write SYS$OUTPUT<$ ask := read SYS$COMMAND /error=ESCAPE /end=ESCAPE /prompt=$ Pid = f$getjpi ("","PID")$ Fyl = "G_''PID'.TMP"$ output_ok = 1$ use_show = 1$ delete_fyl = 1$$GET_P1:4$ if p1 .eqs. "" then ask "Show (or do) what? " p1$$ if p1 .eqs. "" then goto GET_P1$$ p1 = f$edit (p1,"UPCASE,COMPRESS")$$GET_P2:4$ if p2 .eqs. "" then ask "String(s) to find? " p2$$ if p2 .eqs. "" then goto GET_P2$&$ if p5 .nes. "" then delete_fyl = 0$$ a1 = f$extract (0,1,p1)$ a2 = f$extract (0,2,p1)$ a3 = f$extract (0,3,p1)$ a4 = f$extract (0,4,p1)&$ if a1 .eqs. "#" then p1 = p1 - "#"&$ if a1 .eqs. "=" then p1 = p1 - "="<$ if (a1 .eqs. "#") .or. (a1 .eqs. "=") then use_show = 0'$ if a1 .eqs. "=" then output_ok = 0$=$ if a2 .eqs. "SH" then use_show = 0 ! Fudge it for SH*OW.$($ if p1 .eqs. "ACL" then output_ok = 0$ if p1 .eqs. "KEY"$ then$ output_ok = 0$ p1 = "KEY /ALL "$ endif0$ if p1 .eqs. "LOGICAL" then p1 = "LOGICAL * "$ if p1 .eqs. "SYMBOL"$ then$ output_ok = 0$ p1 = "SYMBOL /ALL /GLOBAL "$ endif$?$ if a2 .eqs. "AN" then use_show = 0 ! Some form of ANALYZE.$$ if a3 .eqs. "NCP" ! NCP.$ then$ output_ok = 0$ use_show = 0$ endif$)$ if (a4 .eqs. "SYSG") .or. - ! SYSGEN or, (a4 .eqs. "AUTH") .or. - ! AUTHORIZE or@ (a4 .eqs. "MCR ") ! MCR something - make assumptions about$$ then ! the MCR target program.$ output_ok = 0$ use_show = 0$ endif$$! Do the DCL command.$$ if output_ok$ then$ if use_show$ then"$ show 'p1' /output='Fyl' 'p3'$ else"$ 'p1' /output='Fyl' 'p3' $ endif$ else$ define SYS$OUTPUT 'Fyl'$ if use_show$ then$ show 'p1' 'p3'$ else$ 'p1' 'p3' $ endif$ deassign SYS$OUTPUT$ endif$$ search 'Fyl' 'p2' 'p4'$$ESCAPE: $ set noon$ if delete_fyl$ then;$ if f$search (Fyl) .nes. "" then delete /nolog 'Fyl';*$ else>$ say "%Output from command remains in file ''f$parse(Fyl)'"$ endifA$ if f$trnlnm ("SYS$OUTPUT") .eqs. Fyl then deassign SYS$OUTPUT$ set on$ $ EXIT 1 + 0 * f$verify (verify)*[JONATHAN.UNITOOLS]GBL.COM;6+,. /( 4- -0123KPWO56栗7xv89L wG(HJ$ v = 'f$verify (0)'"$ gpf = f$getsyi ("free_gblpages")$ gpt = f$getsyi ("gblpages")$ gpu = gpt - gpf"$ gsf = f$getsyi ("free_gblsects") $ gst = f$getsyi ("gblsections")$ gsu = gst - gsf($ say "Global Resource Free Used Total"($ say "--------------- ---- ---- -----"*$ say "Global Pages ''gpf' ''gpu' ''gpt'"-$ say "Global Sections ''gsf' ''gsu' ''gst'"$$ EXIT 1 + 0 * f$verify (v)*[JONATHAN.UNITOOLS]REX.COM;7+,. /( 4M J-0123KPWO56cld7 v89L wG(HJ$ verify = 'f$verify(0)'M$! REX.COM Count records in file(s). Can use wildcards & lists in filespec.$6$ ask := read SYS$COMMAND /error=END /end=END /prompt=$$START:*$ if p1 .eqs. "" then ask "File(s)? " p1#$ if p1 .eqs. "" then goto START$$ copy /log 'p1' NL:$$$END: EXIT 1 + 0 * f$verify (verify)*[JONATHAN.UNITOOLS]WS.COM;3+,. /( 4O -0123KPWO56N7fyPv89L wG(HJ$ verflg = 'f$verify(0)'$! Working Set Information.$ $ pid = "" $ ctx = ""$$ say -" Working Set Information"$ say ""$ say -*" WS WS WS WS Pages Page"$ say -O"Username Processname State Extnt Quota Deflt Size in WS faults Image"$ say ""$ $ if p1 .nes. "" then pid = p1$START:)$ if p1 .eqs. "" then pid = f$pid (ctx)"$ if pid .eqs. "" then goto END+$ username = f$getjpi ("''pid'","USERNAME"))$ if username .eqs. "" then goto START($ Procnam = f$getjpi ("''pid'","PRCNAM")<$ imgnam = f$parse (f$getjpi ("''pid'","IMAGNAME"),,,"NAME")&$ state = f$getjpi ("''pid'","STATE")($ wsdef = f$getjpi ("''PID'","DFWSCNT"))$ wsquota = f$getjpi ("''pid'","WSQUOTA")+$ wsextent = f$getjpi ("''pid'","WSEXTENT")'$ wssize = f$getjpi ("''pid'","WSSIZE")($ glbpags = f$getjpi ("''pid'","GPGCNT"))$ procpags = f$getjpi ("''pid'","PPGCNT")*$ pagflts = f$getjpi ("''pid'","PAGEFLTS")$ pages = glbpags + procpags$,$ say f$fao ("!AS!15AS!5AS!5(6SL)!7SL!AS", -2 username,procnam,state,wsextent,wsquota,wsdef, -" wssize,pages,pagflts," "+imgnam)#$ if p1 .eqs. "" then goto START$ .$END: if verflg then $ EXIT f$verify(1) + 1$ EXIT 1*[JONATHAN.UNITOOLS]XW.COM;3+,./( 4P "-0123KPWO 56*K7fvv89L wG(HJ$ verify = 'f$verify(0)'P$!------------------------------------------------------------------------------$! X W . C O M$!K$! From a VMS DECwindows workstation, run a DECwindows application program$! on a remote node.$!$! Assumptions:G$! - For execution on a remote server from a VAXstation, the user has a3$! proxy login enabled on the remote server node.@$! - By default, the image to be executed has a name of the formI$! SYS$SYSTEM:DECW$xx.EXE where "xx" is the image identification passed:$! to this procedure (e.g. CALENDAR, PAINT, CALC, etc.).J$! - Because of a 12 character limit to the length of the string passed toI$! the DECNET TASK object, the image name (or image pseudonym) can haveJ$! a maximum length of 10 characters or less, depending on the length of@$! the name of the NCP TASK which executes this DCL procedure.G$! If no NCP TASK is defined, then the length of the parameter to the-$! task will be (11 - length_of_proc_name).D$! For example, if this procedure is in a file called DWR.COM, the2$! maximum image identification is 8 characters.D$! - For a non-DECnet invocation, the image/command parameter has no"$! imposed minimum length limit.$! $! Usage: @XW p1 [p2] [p3] [p4]E$! where p1 is an image identification / command string; (required)9$! p2 is a client on which to display; (optional)0$! p3 is a server on which to run; (optional)I$! p4 is a parameter/qualifier set for the SET DISPLAY cmd. (optional)$! $! Examples:9$! - To run the DECwindows calculator on node BIGVAX from2$! a VMS VAXstation, do $ @XW CALC "" BIGVAXI$! - To run the DECwindows bookreader to display on node 128.250.9.9 fromI$! a telnet session on a VAXcluster node, do $ @ XW BOOK 128.250.9.9$!P$!------------------------------------------------------------------------------O$! Author: Jonathan Ridler (with thanks to Chris Chaundy for some ideas here).'$! Information Technology Services,#$! The University of Melbourne.$!$! Date: 12-Jun-1991. $! Modified:P$!------------------------------------------------------------------------------$$ on error then goto END$ say := write SYS$OUTPUT$$$ network = f$mode() .eqs. "NETWORK"!$ node = f$getsyi ("NODENAME"),$ remote = f$trnlnm ("SYS$REM_NODE") - "::"%$ display = f$trnlnm ("DECW$DISPLAY")M$ VAXstation = (f$getsyi ("WINDOW_SYSTEM") .eq. 1) .and. (display .nes. "")$ temp_display = 0$$ screen = 0 ! default$ xport = "TCPIP" ! default$ $ cmd = p1 $ client = p2 $ server = p3 $ if network$ then$ client = remote$ xport = "DECNET"$ endif$;$ if .not. network ! ... then it's the initiating process.$ then!$ on control_y then goto END$ set control = (Y,T)$$ if cmd .eqs. ""$ thenM$ say "%XW-ERROR, A DECwindows application or command must be specified."$ goto END $ endif$K$ if f$locate (".",client) .eq. f$length (client) then xport = "DECNET"$$ if VAXstation$ then/$ if client .eqs. "" then client = node2$ if client .eqs. node then xport = "LOCAL"7$ if server .nes. "" ! Fire it off, then terminate. $ then$ if client .eqs. node$ then)$ open net1 'server'::"task=XW ''cmd'"$ close net1$ elseJ$ say "%XW-ERROR, Execution and display not on client is not supported."$ endif:$ goto END ! End of VAXstation initiation of application $ endif8$ else ! It's something other than a VMS VAXstation.$ if client .eqs. "" $ then$ if remote .nes. ""$ then$ client = remote$ elseH$ say "%XW-ERROR, A remote node name on which to display is required." $ goto END$ endif $ endif$$ colon = f$locate (":",client))$ client = f$extract (0,colon,client)B$ screen = f$extract (colon+1,f$length(client)-colon-1,client)*$ if screen .eqs. "" then screen = 0 $ endif$ endif$$! Run application:=$! Make it easier to use standard DECwindows applications ...$/$ if cmd .eqs. "BOOK" then cmd = "BOOKREADER".$ if cmd .eqs. "CARD" then cmd = "CARDFILER"$$$ if (cmd .eqs. "BOOKREADER") .or. - (cmd .eqs. "CALC") .or. -" (cmd .eqs. "CALENDAR") .or. -# (cmd .eqs. "CARDFILER") .or. - (cmd .eqs. "CLOCK") .or. - (cmd .eqs. "MAIL") .or. -! (cmd .eqs. "NOTEPAD") .or. - (cmd .eqs. "PAINT") .or. -C (cmd .eqs. "PUZZLE") then cmd = "run SYS$SYSTEM:DECW$''cmd'"$@$! Include pseudonym handling for non-standard commands here ...$P$ if cmd .eqs. "DECTERM" then cmd = "create /terminal=decterm /detach /nologg"H$ if cmd .eqs. "DECTERMN" then cmd = "create /terminal=decterm /detach"F$ if cmd .eqs. "DECTERMP" then cmd = "create /terminal=decterm /wait"$ if cmd .eqs. "EVE" then -? cmd = "edit /tpu /display=decwindows /section=TPU$SECTION":$ if (cmd .eqs. "FILEVIEW") .or. (cmd .eqs. "VUE") then -& cmd = "run SYS$SYSTEM:VUE$MASTER":$ if cmd .eqs. "VIEW" then cmd = "view /select=x_display"$"$ if cmd .eqs. "" then goto END$ $ if network$ then#$ open net2 /read /write SYS$NET$ close net2$ endif$K$! If the display doesn't already exist, create it ... then do the command!$0$ if (display .eqs. "") .or. (client .nes. node)$ thenO$ set display /create /node='client' /screen='screen' /transport='xport' 'p4'$ temp_display = 1$ endif$$ 'cmd'$$END:,$ if temp_display then set display /delete$ if network then EOJ$)$ if verify then $ EXIT f$verify(1) + 1$ EXIT 1*[JONATHAN.UNITOOLS]Z.COM;28+,. /( 4P -0123KPWO56eI>7v89L wG(HJP$! Command procedure to continuously SHOW something (assume VT100-type display).?$! Exit with CONTROL_C, CONTROL_Y, CONTROL-Z, or if any errors.$!=$! Press RETURN at any time to completely refresh the screen.$!N$! P1 = option for SHOW command (required), or if first character is "#" thenO$! the command is not a show command. If the first character is "_" then=$! disable error handling for the command and check for "#".J$! P2 = optional time between updates (in seconds); default is 5 seconds./$! P3 = optional display formatting character:>$! if absent (default), home cursor before each re-display;K$! if a "C" (for "Continue"), print a blank line before each re-display;I$! if any other character, always clear screen before each re-display.$$ esc[0,8] = 27$ home = esc + "[H"$ clear = home + esc + "[J"$ use_show = 1$ no_fail = 0$$ say := write SYS$OUTPUT9$ ask := read SYS$COMMAND /error=DONE /end=DONE /prompt=?$ ask2 := read SYS$COMMAND /error=SKIP /end=DONE /prompt=""""""$ $ on control_y then goto DONE$ASK_IT:,$ if p1 .eqs. "" then ask "Show what? " p1$$ if p1 .eqs. "" then goto ASK_IT)$ p1 = f$edit (p1,"COMPRESS,TRIM,UPCASE")$GET_IT:$ a1 = f$extract (0,1,p1)$ a2 = f$extract (0,2,p1)$ if a1 .eqs. "_"$ then$ p1 = p1 - "_"$ no_fail = 1$ goto GET_IT$ endif$ if a1 .eqs. "#"$ then$ p1 = p1 - "#"$ use_show = 0$ endif=$ if a2 .eqs. "SH" then use_show = 0 ! Fudge it for SH*OW.$$ if p2 .le. 1 then p2 = 5$ if p2 .gt. 60 then p2 = 60$$ zot = "home"&$ if p3 .nes. "" then zot = "clear"%$ if p3 .eqs. "C" then zot = """""" $ say clear$$LOOP:$ on warning then goto DONE$ if no_fail then set noon $ if use_show$ then $ show 'p1'$ else$ 'p1'$ endif$ if no_fail then set on$ ask2 /timeout='p2' junk $ say clear$SKIP: $ say 'zot' $ goto LOOP$$DONE:$ EXIT 1p