in reply to User interaction mid script again
All you need to add before it is something like:$exp->expect($timeout, [ qr/username: /i, sub { my $self = shift; $self->send("$username\r"); exp_continue; }], [ qr/password: /i, sub { my $self = shift; $self->send("$password\r"); exp_continue; }], $shell_prompt);
I've never used Expect, but the POD seems pretty clear.print "username: "; my $username = <STDIN>; print "password: "; my $password = <STDIN>; chomp $username; chomp $password;
rdfield
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: User interaction mid script again
by markd (Acolyte) on Dec 04, 2003 at 17:01 UTC |