The second is pretty much as detailed as it gets for IOS TCL scripting. But for file system manipulation, all of the standard TCL 8.3 code procedures will work (except for those listed athttp://www.cisco.com/univercd/cc/td/doc/product/software/ios123/123newft/123t/123t_2/gt_tcl.htm#wp1027175 ). We did not add any TCL extensions for dealing with files. For example, copying a file to a TFTP server is as easy as:
exec "copy flash:myfile tftp://10.1.1.1/myfile"
If you need to open and read a file:
set fd [open "flash:/myfile" "r"]
while { ! [eof $fd] } {
set line [read -nonewline $fd]
puts $line
}
close $fd
So any general TCL scripting guide will do. Just remember that the underlying CLI toolchain is IOS EXEC; so every command you can run from the CLI, you can also run via TCL's exec procedure.