Insert Responses to Command Prompts in Tclsh

I have been aware of the typeahead Tcl command for months, but somehow I never got it to work.

It works perfectly in IOS release 12.4(15)T (it might have something to do with other fixes to Tclsh), so to clear interface counters (as Michal would like to do), this is what you can do:

typeahead "y"
exec "clear counter dialer 0";

Warning: if the input is not consumed by the executed commands, it stays in the typeahead buffer; quite dangerous if you have a sequence of commands, as the wrong command could be acknowledged.

Add comment