Fix the "do" command
The do command available in configuration modes of Cisco IOS is probably one of the best features ever implemented in IOS, but you tend to continue typing the do keyword even in the exec mode, resulting in syntax errors. The alias command doesn't help as you cannot specify an empty command line. However, there is a Tcl-based workaround.
Store the following Tcl code in flash:do.tcl:
puts [exec $argv]Configure alias exec do tclsh flash:do.tcl and you can execute the do command from exec mode.
The simple solution does not page the output, a lot more work would be needed to implement the proper paging functionality
I'd try out your fix do command but I found error as shown below.
######################################
Router#tclsh
Router(tcl)#set x [open "flash:do.tcl" w+]
Router(tcl)#set do {
+>puts [exec $argv]
+>}
puts [exec $argv]
Router(tcl)#puts $x $do
Router(tcl)#close $x
Router(tcl)#tclquit
Router#show flash:
System flash directory:
File Length Name/status
1 20 do.tcl [invalid checksum]
[84 bytes used, 8388520 available, 8388604 total]
8192K bytes of processor board System flash (Read/Write)
Router(config)#alias do tclsh flash:do.tcl
^
% Invalid input detected at '^' marker.
Router(config)#
######################################
Any suggestion?
Will try on real router and see result again. Anyway did alias do tclsh flash:do.tcl work? :D (I'm apologize if my question look impolite).
Thanks for the correction!
it's now work fine.