From: Eric T. <zi...@gm...> - 2006-07-25 17:14:16
|
In the following debug statement: spawn id(5): Does `sys hard\r\n' match: pattern #1: -ex `/# '? No. It shows that expect is reading back a \r\n (CR and a LF) when it is only sent with a \n (LF). Is there some sort of terminal translation that may be adding this extra bit on? \r\n as far as I know is only used by Windows based platforms. On Linux and BSD only thr LF is used (\n). I am assuming that it is some sort of tty or pty issue, could you offer some guidance in that area? Plus the "Connection was closed" message is returned to the client when the connection is lost. It does not really denote which side initiated it. I do know that sysread is failing to read from the socket which is causing $nread to be null which is causing $nread to be set to 0 which is causing the hard_close to be called. How can this not be an expect issue if all this is already known? Plus the fact that tcl expect and python expect as well as a manual ssh session via cli all work as they are suppose to, to me means that it has to be something in perl expect. On 7/25/06, Roland Giersig <RGi...@cp...> wrote: > > Hi Eric, > > there must be some other reason, it's definitively not Expect: > > > spawn id(5): Does `sys hard\r\nConnection to batista closed.\r\r\n' > > This clearly indicates that the ssh connection was lost on its own and > Expect got the EOF as a result of that. > > But I have no idea where that could come from, sorry... > [a hunch: maybe some issue with "\r" versus "\n", try send("sys > hard\r")] > > Regards, Roland > -- > RGi...@cp... > |