Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site ucbvax.ARPA Path: utzoo!watmath!clyde!burl!ulysses!ucbvax!cit-vax.arpa!engvax!KVC From: KVC@engvax.UUCP Newsgroups: fa.info-vax Subject: Kept TPU procedure Message-ID: <8509090345.AA14944@cit-vax.ARPA> Date: Sun, 8-Sep-85 20:33:15 EDT Article-I.D.: cit-vax.8509090345.AA14944 Posted: Sun Sep 8 20:33:15 1985 Date-Received: Tue, 10-Sep-85 03:30:48 EDT Sender: daemon@ucbvax.ARPA Reply-To: info-vax@ucb-vax.arpa Organization: The ARPA Internet Lines: 67 Here's a handy little command procedure that lets you keep TPU running all the time in a background process similar to kept EMACS. /Kevin Carosso engvax!kvc @ CIT-VAX.ARPA Hughes Aircraft Co. -------------------------- KEPT_TPU.COM --------------------------------- $ veri = F$VERIFY(0) $ ! $ ! KEPT_TPU.COM $ ! $ ! Written by Kevin Carosso at Hughes Aircraft Co., S&CG/CTC 8/8/85 $ ! Modelled after KEPTEMACS. $ ! $ ! This procedure performs the kept TPU function. $ ! $ ! If there is a process called "TPU terminal-name" then ATTACH to it $ ! because it's the waiting TPU. If not just SPAWN a TPU with the $ ! P1 ... P8 parameters. This means that any qualifiers you want to $ ! pass to TPU need be separated from the "@KEPT_TPU" by the file, so they $ ! will appear as Pn, rather than qualifiers to the "@" itself. For $ ! example: $ ! $ @KEPT_TPU zeep.txt/section=edtsecini $ ! $ @KEPT_TPU zeep.txt /section=edtsecini $ ! $ @KEPT_TPU "/section=edtsecini" zeep.txt $ ! $ ! should all work. $ ! $ ! To get back to your parent, just issue the "ATTACH" command with $ ! no arguments. Note that this procedure will work with LSE if you $ ! change the EDIT command in the spawn. $ ! $ TPU_name = "TPU " + f$log("TT") $ priv_list = f$setprv ("NOWORLD, NOGROUP") $ pid = 0 $ 10$: $ proc = f$getjpi( f$pid( pid ), "PRCNAM" ) $ if proc .eqs. TPU_name then $ goto attach $ if pid .ne. 0 then $ goto 10$ $ spawn: $ priv_list = f$setprv( priv_list ) $ $ write sys$error - "[Spawning a new Kept TPU]" $ $ args = P1 + " " + P2 + " " + P3 + " " + P4 + " " + - P5 + " " + P6 + " " + P7 + " " + P8 $ define/user sys$input sys$command $ spawn /process="''TPU_name'" - /nolog - EDIT/TPU 'args $ write sys$error - "[Attached to DCL in directory ''f$logical("SYS$DISK")'''f$directory()']" $ $ GOTO quit $ attach: $ priv_list = f$setprv( priv_list ) $ $ write sys$error - "[Attaching to Kept TPU]" $ assign/user sys$command sys$input $ attach "''TPU_name'" $ write sys$error - "[Attached to DCL in directory ''f$logical("SYS$DISK")'''f$directory()']" $QUIT: $ if veri then set verify $ exit