From: Mopuri, S. <sha...@in...> - 2006-04-20 22:41:13
|
Hi, I am trying to invoke telnet using Expect from Perl in Cygwin. The same code works in Linux systems which means there is something different when invoked from Cygwin shell. Can anyone suggest any workarounds or suggestions to fix this issue.=20 Below is the sample code that I am trying to get it work Thanks, Shailaja #!/usr/bin/perl # use module use XML::Simple; use Expect; #Create the Expect handle $Expect_Handle =3D new Expect; $Cmds =3D "telnet atsism01 623"; $Responses =3D "server:"; $Result =3D $Expect_Handle->spawn($Cmds."\n"); # Clears the previous output accumulated incase of match failures $Expect_Handle->clear_accum(); $Pattern_ID =3D $Expect_Handle->expect($Timeout,'-re', $Responses); #Capture the current prompt $Current_Prompt =3D $Expect_Handle->match(); #Capture the output $ActualOutput =3D $Expect_Handle->before().$Current_Prompt; =09 |