[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

790.0. "Opening windows on remote systems?" by 32291::SILVA (Carl Silva) Tue May 16 1989 20:43


	Is it possible to set up a command file so that I can open a window
from my work station on someone else's workstation or on another system?  Can
this be done with ULTRIX and VMS?

	Carl

T.RTitleUserPersonal
Name
DateLines
790.14356::PORTERdig this, cats!Wed May 17 1989 00:0818
    Well, yes, since X is explicitly designed for separate client/server
    operation.
    
    What exactly do you mean by "set up a command file"?   
    
    To my mind, this qualifies (using VMS syntax, but the same sort of
    thing can be done for Ultrix) ...
    
    	$ set display /node=foo::
    	$ run sys$system:decw$something
    
    where 'decw$something' is the application you're trying to run.
    Is that what you had in mind?
    
    Terminal emulator windows need a little more trickery.  The
    unsupported utility CHILD might be handy to use for such a
    thing.

790.2Here's an example18891::HARLEYPeople just don't freak out like they used to...Wed May 17 1989 12:2430
I use this file to start up a remote VUE session...

$
$ ! This command file starts up a DECwindows vue session.
$
$ Task_Type = F$Mode()
$ If Task_Type .eqs. "OTHER"
$  Then
$    Set Display/Create/Node=Gofer
$    MCR VUE$Master
$    Set Display/NoPerm
$  Else
$    If Task_Type .eqs. "NETWORK"
$     Then
$       Define Sys$Output Sys$Net:
$       Write Sys$Output "This is node ", F$GetSYI("NodeName")
$    EndIf
$
$    Run/Detached/Authorize Sys$System:LoginOut -
        /Input='F$Environment("Procedure")      -
        /Output='F$TrnLnm("Sys$Login")'Vue.Log  -
        /Process= "DECW$Vue"
$ EndIf
$

I do a $ Type Node::"0=VUE" (I have a proxy on Node::), and it starts right up
on my GPX...

/Harley

790.3remote run procedure40382::HOSSFELDI'm so confused!Wed May 17 1989 12:49250
This will remotely run a file through decw$ if you have proxe on the remote 
system and allow security access to your session manager.  

Load it and run @thisfile help
*********** cut *******
$ goto top 
$!
$ ! remsub.com
$ ! created to get around using DECnet 0 tasks for
$ ! corporate security reasons!
$ ! executed on your workstation
$ !Features:
$ ! 1. Uses submit/remote to keep the net police happy.
$ ! 2. Run's /detatched to free up the batch queue slot.
$ ! 3. Takes node-name, command
$ ! 4. Runs from the workstation.
$ ! modified 1/12/89 to optionally accept process_name and general cleanup
$ !	 	== ken miller ==
$ ! modified 3/89 to allow more defaults and cmd line input and help 
$ !
$TOP:
$!  set these to what ever defaults you want?
$ def_node = 	"LAS057"                    ! node if not specifid
$ def_cmd  =	"VERB"                      ! function if not specifid
$ def_prog =	"DECW$MAIL"                 ! application if not specifid
$ cmd  :=
$ cmd1 :=
$ node := 
$ prog :=
$!
$ file_num = 0
$ func = "func"
$ tell = "write sys$output"
$ file = "write temp"
$ run_opts = "MCR/MC/M//RUN/R/@/VERB/V/"         ! this is whats allowed now
$ no_cmd  = "VERB/"                       ! no command opts 
$ sel_opts = "NODE/PROGRAM/PROG/"         ! this is whats allowed now
$ ext_opts = "EXT/EXTEND/CMD1/"           ! extended command
$ parm  :=
$ parm1 :=
$ x=0
$!
$NOINPUT:
$   if p1 .NES. "" then goto start
$       inquire p1 "Command? [""''def_cmd'""] "
$       if p1 .eqs. "" then p1 = def_cmd 
$       inquire p2 "Application? [""''def_prog'""] "
$       if p2 .eqs. "" then p2 = def_prog
$       inquire p3 "Remote Node? [''def_node'] "
$       if p3 .eqs. "" then p3 = def_node
$       Goto start
$!
$HELP:
$   'tell "Remotely run an object and display it here "
$   'tell "    Run options are as follows:    "
$   'tell "        Option1 - to select node             type: NODE name  "
$   'tell "                  to select the command      type: MCR, VERB, RUN or @ "
$   'tell "                  to select the program      type: PROG filespec "
$   'tell "                  to select Optional command                 "
$   'tell "                   for the remote system it "
$   'tell "                   should be the last elements "
$   'tell "                                             type: EXT spec "
$   'tell "         i.e. $ RUN NODE foo PROG CMS/DECW EXT SET DEF [.DEV]"
$   'tell " "
$   'tell "        Option2 - (@, RUN, VERB or MCR) NODE::FILESPEC EXTENDED_CMDS"
$   'tell " "
$   'tell "        Option3 - (@, RUN, VERB or MCR) NODE FILESPEC EXTENDED_CMDS"
$   'tell "  "
$   'tell "        Note :To run a program with parameters put the command and "
$   'tell "              and the parameters in quots" 
$   EXIT

$START:
$DO_PARM:
$   x=x+1
$   p'x' = f$edit(p'x', "UPCASE")
$   parm = p'x'
$   if parm .eqs. "HELP" then goto help
$   if parm .EQS. "" then goto run
$   IF (F$LOCATE(parm+"/",RUN_OPTS) .NE. F$LENGTH(RUN_OPTS)) .OR -
        (F$LOCATE(parm+"/",NO_CMD) .NE. F$LENGTH(NO_CMD)) THEN goto cmd
$   IF F$LOCATE(parm+"/",SEL_OPTS) .NE. F$LENGTH(SEL_OPTS) THEN goto 'parm
$   IF F$LOCATE(parm+"/",EXT_OPTS) .NE. F$LENGTH(EXT_OPTS) THEN goto ext
$   gosub options
$   goto do_parm
$!
$NODE:    ! get the node name
$   x=x+1
$   parm = p'x'
$NODE1:
$   node = f$extract(0,f$locate(":","''parm'"),"''parm'")
$   goto do_parm
$!
$CMD:    ! get the node name
$   parm = p'x'
$   cmd = parm
$   if cmd .EQS. "V" then cmd := VERB
$   if cmd .EQS. "R" then cmd := RUN
$   if (cmd .EQS. "M") .OR. (cmd .EQS. "MC") then cmd := MCR
$   goto do_parm
$!
$EXT:    ! get the node name
$   x=x+1
$   parm = p'x'
$   if parm .EQS. "" then goto do_parm
$   cmd1 = cmd1 + parm + " "
$   goto ext
$!
$!
$PROGRAM:    ! get the program name
$PROG:
$   x=x+1
$   parm = p'x'
$PROG1:
$   prog = parm
$   if f$extract(0,1,prog) .NES. "@" then goto prog2 
$       cmd = "@"
$       prog = f$extract(1,f$length(prog),prog)
$PROG2:
$   if f$locate("::","''prog'") .EQ. f$length("''prog'") then goto prog3
$       parm = prog
$       node = f$extract(0,f$locate(":","''parm'"),"''parm'")
$       prog = f$extract(f$locate("::","''prog'")+2,f$length("''prog'"),"''prog'")
$PROG3:
$   goto do_parm
$!
$OPTIONS:
$   if prog .EQS. "" then goto PROG1
$   if node .EQS. "" then goto node1
$   return
$   
$!
$RUN:
$!  set defaults 
$   if prog .EQS. "" then prog = def_prog
$   if node .EQS. "" then node = def_node
$   if cmd .EQS. "" then cmd = def_cmd 
$   IF F$LOCATE(cmd+"/",NO_CMD) .NE. F$LENGTH(no_cmd) .OR. -
        f$locate("/","''prog'") .NE. f$length("''prog'") then cmd :=
$!
$   WS_node = f$extract(0,f$locate(":",f$trnlnm("SYS$NODE")),f$trnlnm("SYS$NODE"))
$   if WS_node .eqs. node 
$       then local_flag = "true"
$       else local_flag = "false"
$   endif
$!
$! strip down the function and give us a name 
$   func = f$edit(prog, "UPCASE,COMPRESS,TRIM")
$   func = f$extract(0,f$locate("/","''func'"),"''func'")    
$   if f$locate(":","''func'") .NE. f$length("''func'") then -
        func = f$extract(f$locate(":","''func'")+1,f$length("''func'"),"''func'")
$   if f$locate("]","''func'") .NE. f$length("''func'") then -
        func = f$extract(f$locate("]","''func'")+1,f$length("''func'"),"''func'")
$   if f$locate("$","''func'") .NE. f$length("''func'") then -
        func = f$extract(f$locate("$","''func'")+1,f$length("''func'"),"''func'")
$   if f$locate(" ","''func'") .NE. f$length("''func'") then -
        func = f$extract(0,f$locate(" ","''func'"),"''func'")
$   func = f$extract(0,f$locate("_","''func'"),"''func'")    
$!
$!
$!
$!  This is the command file that will run the requested program 
$!
$!
$!
$    on warning then EXIT
$    dir/out=nla0: 'node::
$NAME:
$!
$    gosub rename
$    on warning then goto got_name
$    dir/out=nla0: 'node::'WS_node'_'func'1.com
$CNG_NAME:
$    goto NAME
$GOT_NAME:
$!
$   'tell "Creating a command file on ''node' with"
$   if cmd1 .NES. "" then  'tell "     ""$ ''cmd1'"" " 
$   'tell "     ""$''cmd' ''prog'"" displayed on ''WS_node' "
$!
$   if local_flag .nes. "true" 
$       then open/write temp 'node::'WS_node'_'func'1.com
$       else open/write temp sys$login:'WS_node'_'func'1.com
$   endif
$   'file "$ set verify"
$   if local_flag .nes. "true" 
$       then 'file "$ set display/create/node=''WS_node'"
$       else 'file "$ set display/create/transport=local"
$   endif
$   'file "$ ''cmd1'"
$   'file "$ ''cmd' ''prog'"
$   'file "$ set display/noperm "
$   'file "$ purge ''WS_node'_''func'*.log"
$   'file "$ del ''WS_node'_''func'*.com;*"
$   close temp
$!
$!
$!  This is the batch file that will create the process and run the command
$!
$!
$   'tell "Creating Batch File "
$   if local_flag .nes. "true" 
$       then open/write temp 'node::'WS_node'_'func'2.com
$       else open/write temp sys$login:'WS_node'_'func'2.com
$   endif
$   'file "$ define sys$print nl:"
$   'file "$ set verify"
$   'file "$ proc_num = 0"
$   'file "$ user = F$EDIT(f$getjpi(0,""USERNAME""),""COLLAPSE"") "
$   'file "$ proc_name = ""''WS_node'$"" + ""''func'"""
$   'file "$ proc_name = f$edit(proc_name, ""COLLAPSE"")
$   'file "$ if (f$length(proc_name) .GT. 12 ) then -   "
$   'file "     proc_name = f$extract(0,12,proc_name)    "
$   'file "$CHECK: "
$   'file "$   on warning then goto cont"
$   'file "$   sho proc/nooutput 'proc_name "
$   'file "$   gosub rename "
$   'file "$   goto check "
$   'file "$CONT:" 
$   'file "$ on warning then proc_name = user "
$   'file "$ sho proc/nooutput 'user "
$   'file "$ run/detached sys$system:loginout.exe -"
$   'file "       /input=''WS_node'_''func'1.com -"
$   'file "       /error=''WS_node'_''func'1.log -"
$   'file "       /output=''WS_node'_''func'1.log -"
$   'file "       /proc='proc_name -                "
$   'file "       /buffer_limit=30000/enqueue_limit=800/extent=10000 -"
$   'file "       /io_buffered=100/io_direct=100/maximum_working_set=2048 -"
$   'file "       /page_file=30000/authorize/file_limit=64/working_set=512"
$   'file "$ exit"
$   'file "$rename:
$   'file "$  proc_num = proc_num + 1
$   'file "$  proc_name = f$extract(0,f$locate(""_"",proc_name),proc_name) + ""_"" + f$string(proc_n
$   'file "$  return 
$   close temp
$!
$   'tell "Submitting Batch Command File..."
$   if local_flag .nes. "true" 
$       then submit/remote/nonotify/noprint 'node::'WS_node'_'func'2.com
$     else submit/notify/noprint sys$login:'WS_node'_'func'2.com
$   endif
$   EXIT
$!
$rename:
$!  if f$locate("_",func) .EQ.f$length(func) then 
$   file_num = file_num + 1
$   func = f$extract(0,f$locate("_",func),func) + "_" + f$string(file_num)
$   return 
0

790.432291::SILVACarl SilvaWed May 24 1989 15:123
	Thanks for the examples.  I'll try them.