Posted to tcl by Napier at Sat Feb 28 01:33:20 GMT 2015view raw

  1. proc RunPing {} {
  2. set fh [open "|ping www.google.com" r]
  3. after 2000
  4. exec kill -INT [pid $fh]
  5. after 2000
  6. set test [lrange [split [read -nonewline $fh] \n] end-1 end]
  7. puts $test
  8. }