You might be aware that there are two ways of executing IOS CLI commands from IOS tclsh: either you insert the IOS commands directly in the Tcl code (tclsh passes any unknown commands to the CLI parser) or you execute them with the exec command. There are subtle differences between the two methods, described in the “Executing IOS commands from Tcl shell article” in the CT3 wiki.
Ivan Pepelnjak, CCIE#1354, is the chief technology advisor for NIL Data Communications. He has been designing and implementing large-scale data communications networks as well as teaching and writing books about advanced technologies since 1990. See his full profile, contact him or follow @ioshints on Twitter.

Can a script be used to replace the IOS?
ReplyDeleteSure.
ReplyDeleteYou have to be careful with the ios_config command in Tclsh. Some config modes require an explicit "end" command passed to them to properly exit out of the config mode and ios_config does not do this for you. The most glaring example is EEM applet config mode. If you use ios_config to configure an eem applet and forget to add an "end" command to the end of the list, that applet will be stuck - can't modify it, can't remove it, all you can do is reload.
ReplyDelete