From: Chris M. <mut...@mc...> - 2003-10-01 19:05:56
|
Hey, First you will have to login to A. That involves what you have, plus you= will have to $exp->expect() for whatever telnet responds with when it asks for the password. Then use a= $exp->send() to send the password. Then $exp->expect() for the prompt on A. Once you are logged into A, use a= $exp->send() to call telnet $B on A to login to B, $exp->expect() for the password prompt, and then $exp->send() it. Once= logged into B, do the same to login to C, and the same for D, and the same for ... -Chris On 10/1/03 at 11:07 AM Hailey Nguyen wrote: >Hi, > >Please show me how to do nested telnet sessions using Expect.pm module? > >1- telnet to machine A >2- from A to mcahine B >3- from M to another machine C > >----- >use Expect; > >my $exp =3D Expect->spawn("telnet $somehost") > or die "Cannot spawn telnet: $!\n"; > >... > >----- >Your help is greatly appreciated. Please reply directly to me since >I am not on the alias. > >Hailey. > > |