in reply to Re^2: Expect.pm early termination?
in thread Expect.pm early termination?

Yes. Since you do $terminal->raw_pty(1), did you test
$terminal->send("sys hard\r\n");

i.e. sending CRLF? The script looks ok, and re-opening filehandles is ok too. It must not be Expect's fault if there's nothing to read from the socket; if nothing was sent, that's perfectly ok. I guess the remote shell doesn't grok the input is terminated, so I'd play with various setings of CRLF translations.

HTH,
--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

Replies are listed 'Best First'.
Re^4: Expect.pm early termination?
by Elijah (Hermit) on Jul 25, 2006 at 17:24 UTC
    Yeah I have tried all combinations of the CRLF issue. I suspect that you are correct in saying that the remote system does not understand what is being sent which is why I was trying setting to raw and all sorts of other things but nothing seems to work.

    What settings of CRLF translation are you refering to? I have tried nunerous combinations of CR LF and CRLF along with raw terminal and setting slave modes, etc..