Do you have a question? Post it now! No Registration Necessary. Now with pictures!
April 25, 2005, 12:42 am
rate this thread
I can't get a more complicated expect script to work, so I broke it
down to the basics, and I can't get that to work either. Maybe I have
been looking at it too long. Anyway, no matter what I do, the log file
is empty, I don't think the spawn command is working. I am not getting
any errors. Suggestions?
my($exp) = new Expect; #Set exp for Expect
#Set Expect options
$exp-> raw_pty(1); #eliminates echo back to expect
$exp-> log_file("/expect.log", "w");
# create an Expect object
$exp-> spawn("ssh 220.127.116.11 -l username")
or die "Cannot spawn $command: $!\n";
$exp-> expect(10, "firstname.lastname@example.org's password: ");