in reply to Re: use telnet to router with expect
in thread use telnet to router with expect

thanks Mike...everything works except the 'show inventory' command. The login succeeds and I see the router prompt. At that point, the script says: 'print $command "show inventory"' and the command does not execute.

Replies are listed 'Best First'.
Re^3: use telnet to router with expect
by RMGir (Prior) on Mar 14, 2014 at 15:05 UTC
    Interesting...

    I'd download a copy of wireshark (a.k.a. tcpdump) and look at what goes over the wire when you do the command interactively with telnet - perhaps there's a \r sent somewhere you're using a \n, for example.


    Mike
Re^3: use telnet to router with expect
by RMGir (Prior) on Mar 14, 2014 at 19:16 UTC
    Another possibility - maybe "hard_close" is closing the command before the server can respond?

    What happens if you switch that to "soft_close", or even expect something you'd see at the end of the inventory before closing?


    Mike