$!****************************************************************************** $!**************************** M A ST E R . C O M ****************************** $!****************************************************************************** $! $! A well documented task to task communication program. $! Initiates connection to slave host and sends across this channel two way $! traffic (commands out and results back) $! $! You will need to change the machine names to whatever is appropriate. $! We'll assume that you have proxy access. The machine you are on should $! have the first program (master.com) in your sys$login directory. The $! Target machine should have the second program (do.com) in your sys$login $! directory. $! $! Dave Stern $! Space Telescope Science Institute $! 3700 San Martin Dr. $! Baltimore, MD 21218 $! SPAN address SCIVAX::STERN $! BITNET address STERN@STSCI $! ARPANET address STERN@SCIVAX.ARPA $! $open/read/write net loki::"task=do" !open channel for two way communication" $loop: $on error then goto errorx $! get input command from master $read/end=ender/error=errorx/prompt="Command? "/time=60 sys$command command $! send command to slave $write net 'command' $loop2: $! now read the results of command from slave $read/end=loop net line $! and check for a termination (DCL wont accept eol as sufficient) $if f$loc("done",line) .lt.F$len(line) then goto loop $! and output results of command on slave host to master host $write sys$output line $! now keep doing this until end of command results $goto loop2 $! $! now ask if master wants another command executed $goto loop $! $errorx: $write net "Some wierd sorta error occurred... BYE!" $! $ender: $close net $!****************************************************************************** $!**************************** D O . C O M ************************************* $!****************************************************************************** $! Must reside in default directory on target host $! $! open logical net channel $open/read/write net sys$net $loop: $! direct command resultant output to file $assign x.x sys$output $! grab command from net channel $read/end=ender/error=errorx/time=60 net command $! and execute it $'command' $! now deassign this output $deass sys$output $! and open results of command to send it back across net to master $open/read in x.x $loop2: $! read results of command line by line $read/end=end2/error=end2 in line $! send results of command line by line back across net $write net line $! keep looping til no more output $goto loop2 $! end of resultant output, therefore tell net done using a unique string $! this will be checked for on the master side $end2: $write net "done" $! close the resultant output file $close in $! and see if there are more commands to execute $goto loop $! $errorx: $write net "Some wierd sorta error occurred... BYE!" $! $ender: $close net $close in