Difference between revisions of "Expect remote commands"
From WA2IAC Wiki
(→Remote Execution with TCL) |
m (→Preamble) |
||
Line 8: | Line 8: | ||
Before going further, "expect" is an application written in the Tcl language. If that's not what your looking for, go away now! | Before going further, "expect" is an application written in the Tcl language. If that's not what your looking for, go away now! | ||
− | I looked around the net for what I wanted: to have expect log onto a remote machine and execute commands there, driven from a | + | I looked around the net (since re-inventing the wheel is rarely |
+ | a good use of time) for what I wanted: to have expect log onto a remote machine (or router) and execute commands there, driven from a file containing a list of commands | ||
+ | on the host that is running expect. | ||
I didn't find it. Bummed, I realized I would need to write it myself. And quickly. | I didn't find it. Bummed, I realized I would need to write it myself. And quickly. | ||
The scrap of code below can certainly be embellished to do all sorts of cool things, | The scrap of code below can certainly be embellished to do all sorts of cool things, | ||
− | with a modicum of understanding of Tcl. | + | with a modicum of understanding of Tcl. This can possibly violate local security policy. Be careful. |
This is one of the reasons I set up this wiki... to be able to post cookbook stuff | This is one of the reasons I set up this wiki... to be able to post cookbook stuff |