scripting - sending "ping" output to a variable -


i trying ping ip addresses in router. use code:

for {set n 0} {$n < 10} {incr n} {puts [exec "ping 199.99.$n.1]} 

but show output. issue don't want see output. send output variable , search content of variable "regexp" , result, , rest of story. don't know how can that.

use set command. puts command prints it's argument.

set pingoutput [exec ping "199.99.$n.1"] 

or append if want ip's results in 1 variable.

set allpingoutput "" {set n 0} {$n < 10} {incr n} {     append allpingoutput [exec ping "199.99.$n.1"] } 

Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

java Extracting Zip file -

C# WinForm - loading screen -