Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Spawning Telnet Sessions From A Script

Status
Not open for further replies.

amvmr

Technical User
Jun 5, 2002
10
US
I am running the same script to access and configure 8 machines at the same time via telnet. I want to spawn 8 telnet sessions which each run the script from one larger script. I need advice on how to spawn a telnet session from within a script?

Thanks
 
One way to do what you are trying to do is use the aspect run command to start new instances of procomm for each machine you want to get into.

for machine = 1 upto 8
...
run pw5 Your_Telnet.dir connect telnet telnet_dir_entry getin_machine_script.wax
pause 8
...
endfor

That is the basic command that will do what you asked.
If there is a need for your machines to be aware of what the others have done there have been other discussions about use of DDE but addressing specific multiple Procomm sessions is an issue that doesn't seem to have been answered adequately. If limited knowledge of other sessions is required it might be possible to use the aspect profilerd, profilewr commands to post info to text files that can be easily checked.

Hope this helps.

DET

 
Another option you have is to write a child script (or 8 if the steps taken on each connection are different enough), then launch each script, one-by-one, with the execute command. Once the child script completes it's activities and returns control to the parent script, it can report its status to the parent script via the predefined global variables in ASPECT (s0-s9, i0-i9, l0-l9, f0-f9).

You could also use these global variables to pass information to the child script. For example, if you have all your telnet entries in the Connection Directory, you could place the connection to attempt in the global string variable s0. The child script would read that value from s0 then make the telnet connection using the command:

dial TELNET s0

aspect@aspectscripting.com
 
run pw5 Your_Telnet.dir connect telnet telnet_dir_entry getin_machine_script.wax


I am sorry I don't understand the syntax of this statement. Can you please explain how it is working in ordinary language or give me some very simple examples?

Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top