From: Victor Cappuccio (cvictor@protokolgroup.com)
Date: Mon Oct 10 2005 - 23:50:33 GMT-3
Hello all,
what I'm doing wrong in this script?
Seems that I have to play a little more in TCL
Thanks
r5#tclsh
r5(tcl)#proc
r5(tcl)#proc piall {n} {
+>(tcl)#192.168.40.4
+>(tcl)#192.168.10.4
+>(tcl)#}
r5(tcl)#{
+>(tcl)#if [regexp "(!!)" ["ping $ip"]]{
+>(tcl)#puts "$ip *Yeap"
+>(tcl)#}
+>(tcl)#else {
+>(tcl)#puts "Nop $ip"
+>(tcl)#}
+>(tcl)#}
invalid command name "
if [regexp "(!!)" ["ping $ip"]]{
puts "$ip *ok"
}
else {
puts "Nop $ip"
}
"
if [regexp "(!!)" ["ping $ip"]]{
puts "$ip *ok"
}
else {
puts "Nop $ip"
}
^
% Invalid input detected at '^' marker.
r5(tcl)#show tcl
invalid command name "show" ^
% Invalid input detected at '^' marker.
r5(tcl)#exit
r5#tcls
r5#tclsh
r5(tcl)#pro
r5(tcl)#proc ping_all {n} {
+>(tcl)#200.0.0.1
+>(tcl)#200.0.0.2
+>(tcl)#200.0.0.4
+>(tcl)#200.0.0.8
+>(tcl)#}
r5(tcl)#exec
r5(tcl)#ping_all
no value given for parameter "n" to "ping_all"
r5(tcl)#ping_all 1
invalid command name "200.0.0.1" ^
% Invalid input detected at '^' marker.
r5(tcl)#
This archive was generated by hypermail 2.1.4 : Sun Nov 06 2005 - 22:00:50 GMT-3