I want to telnet into a Cisco router, login and execute a Tcl script that is locally stored in the router’s flash. This Tcl script does some processing and should return a nested hash (preferred) or a string that represents a XML document.
Is there a way to map a Tcl nested hash to a Perl nested hash, or to return a string that represents a XML document? Does Expect allow me to do any of the above, and how?
This expect script should take the file off the router and leave it in /tmp/xferfile.txt. It will need to be modified with the commands that actually produce the file, since I do not have those, I left placeholders for them in the script. You should be able to use Donal’s code for that.
It’s been a while since I’ve played with expect and cisco IOS, so bear with me if this needs some debugging on your end.