Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!hacgate!lori From: lori@hacgate.UUCP (Lori Barfield) Newsgroups: comp.sys.apollo Subject: Re: Handy Aegis Script Message-ID: <6355@hacgate.UUCP> Date: 6 Dec 89 00:27:10 GMT References: <6354@hacgate.UUCP> Reply-To: lori@hacgate.UUCP (Lori Barfield) Organization: Hughes Aircraft Co., El Segundo, CA Lines: 83 In article <6354@hacgate.UUCP> lori@hacgate.UUCP (Lori Barfield) writes: >All of my Aegis stuff was written on SR9; better ways may exist now. Here's another that I get asked for sometimes, my version of "phone" for DMs. It takes advantage of an ASCII registry file to convert human names to user ids-- very simple to edit that out if you don't have one. Works on user ids, node numbers, or their fragments. Handy for putting a large message window on a DM with no one currently logged in. (alarm_servers are usually set up only when a user is logged on a node.) ------------------------------------ cut here ------------------------------- # "talk" # creates input-echo pad on display manager currently in use by given person # 1 arg: user name (human or logon) or fragment of same --OR-- # '-n nodenumber' # eon # # "constants" # registry := '/tss/com/registry_list' # # variables # logonID := ''; node_spec := ''; node := ''; num_matches := 0; talk_to_node := false; # # # get argument: user name fragment or node id # if eqs ^1 then /com/args '' 'You forgot to supply recipient. Assuming root.' '' recpnt := 'root' else if eqs ^1 '-n' then node := ^2 talk_to_node := true else recpnt := ^1 endif endif endif # # # talk directly to node # # count node matches; handle errors # if ((^talk_to_node)) then /com/lcnode -b -id | /com/fpat -i -c -rm 2 ^node | read num_matches if ((^num_matches < 1)) then /com/args '' 'No matching node number found in ring.' '' else if ((^num_matches > 1)) then /com/args '' 'Node number fragment not unique in ring.' '' else /com/lcnode -b -id | /com/fpat -i ^node | read node /com/crp /com/crpad -on ^node -me endif endif # # # talk to given user # # count user name matches; handle errors # else /com/fpat -i -c -rm 2 ^registry -p ^recpnt | read num_matches if ((^num_matches < 1)) then /com/args '' 'Recipient name fragment not found in user registry.' '' else if ((^num_matches > 1)) then /com/args '' 'Recipient name fragment not unique in user registry.' '' else # # have logon name; find node logged in to; handle error # /com/fpat -i ^registry -p ^recpnt | read logonID node_spec := ^"/com/lusr | /com/fpat ^logonID"-'*** diskless'-^logonID if eqs ((^node_spec)) then /com/args '' 'Recipient not logged in to a Display Manager.' '' else for node in ^node_spec by word; exit; endfor # 1st word is node /com/crp /com/crpad -on ^node -me endif endif endif endif