From: <Chr...@Ve...> - 2002-12-13 19:05:10
|
Just throw your perl-expect script into a shell script. Like the following: #!/bin/ksh FtpScript.pl Server1 & FtpScript.pl Server2 & FtpScript.pl Server3 & OPTIONAL for logging to a file FtpScript.pl Server4 >/some/dir/here/Server4.log & FtpScript.pl Server5 >/some/dir/here/Server5.log & etc.... This will launch each script in the background. You can also throw the out put into a log file if you want to see the data incase one of the scripts failed on a server. FtpScript #!/usr/local/bin/perl use Expect; my ($IP) = @ARGV; %ENV=(%ENV, TERM=>vt100, term=>vt100); ($telnet = Expect->spawn("ftp $IP")) || die "Could not spawn telnet"; #And the rest of your expect script to follow........ -----Original Message----- From: al....@ac... [mailto:al....@ac...] Sent: Friday, December 13, 2002 12:04 PM To: exp...@li... Subject: [Expectperl-discuss] Just a Question Hello, I recently started using Expect (1.15) with Perl (5.8.0) on Solaris ( 8 ) to automate some routine tasks. These tools have been of great help to me. Many thanks to the people who have developed and support these tools. I have written a script that ftps a file to about 20 servers (one server at a time) on demand. This process works fine but it could take long time (depending on the file size) for it to complete (please don't get hang on the ftp). I would like to rewrite my script so that it can execute the same command (like ftp) from my main server on all the other servers simultaneously ( I am not sure if this is called multi threading). Could someone please point me to some documents that can help me understand what is involved in writing such a script (like what is involved in estalishing connections to multiple servers simultaneously and control over input/output/error messages) . Since I am new to Expect, and not a strong Perl programmer, I was hoping maybe someone have already done something similiar to what I need to do. Any comments, sample program, or information is greatly appreciated. This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited. ------------------------------------------------------- This sf.net email is sponsored by: With Great Power, Comes Great Responsibility Learn to use your power at OSDN's High Performance Computing Channel http://hpc.devchannel.org/ _______________________________________________ Expectperl-discuss mailing list Exp...@li... https://lists.sourceforge.net/lists/listinfo/expectperl-discuss |