proc dumpFoundCB {fid} {set count 1 while { $count > 0 } { set count [gets $fid line] ;# read a line of input puts stdout ">> $line" } if { $count == -1 } { ;# end of file echo "\n\nFinished" exit 0 } }
set cmd {| /bin/find /usr -name "*" -print}
# open the pipe if [catch {set f [open $cmd ] } msg ] { echo "open failed" exit 1 }
#setup read handler on it.. VtAddInput $f dumpFoundCB VtMainLoop