basic TCL ping script on roids!

R1#tclsh
R1(tcl)#foreach i {
+>(tcl)#1.1.1.1
+>(tcl)#2.2.2.2
+>(tcl)#3.3.3.3
+>(tcl)#4.4.4.4
+>(tcl)# } {if {[regexp “!” [exec “ping $i”]]} {
+>(tcl)# puts “$i – success”
+>(tcl)# } else {
+>(tcl)# puts “$i – failed”
+>(tcl)# }
+>(tcl)#}
1.1.1.1 – success
2.2.2.2 – success
3.3.3.3 – failed
4.4.4.4 – failed

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s