# TCL scripting for IOS

Introduction

Documentation

Loops
Router#tclsh
Router(tcl)#for {set i 1} {$i<10} {incr i} {
+> for {set j 1} {$j<3} {incr j} {
+>  ping 192.168.$i.$j repeat 1 timeout 1
+> }
+>}

Router(tcl)#foreach address {
+>192.168.0.1
+>192.168.0.10
+>192.168.0.100
+>} {ping $address}
Procedures
Router(tcl)#proc p {text} {
+> puts $text
+>}

Router(tcl)#p "Hello world!"

No comments: