question regarding EXPECT

I am rather new to using expect and have only written a few scripts using it. I am trying to create a script that will read a file containing a number of hostnames and then for each one: ssh into the box, run a command, scp the output back to a center server.

So far I can make all that happen on one server by using the hostname directly in the script.

I need help incorporating a loop so that I can have it run through every machine listed in my hostnames file. I appreciate any help that you can provide.

Thanks,
Jerrod

Here is an Expect Autologin Script for SSH

This should get you going in the right direction.

Also, here is the expect(1) - Linux man page

Neo

PS: I would write the script you are working on in PERL or PHP.

Thanks NEO but that is pretty much what I already have.

I just need to find out how to incorporate a loop in expect so that i can run the script over and over again for a huge list of servers.

Thanks.