|
Posted by craig.carl on April 24, 2005, 8:42 pm
Please log in for more thread options
All -
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?
#!/usr/bin/perl
#!/usr/bin/expect
use Expect;
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");
$exp-> debug(0);
# create an Expect object
$exp-> spawn("ssh 144.48.81.20 -l username")
or die "Cannot spawn $command: $!n";
$exp-> expect(10, "username@144.48.81.20's password: ");
$exp-> send("passwordr");
Thanks,
C
|