Getting timed output to display.



newbe question, I thinks...

I would like to display in a window the output of iostat and like commands
as each line comes in.
I don't seem to be able to. It seems to wait until the end of all output
and then displays.
Here's the code.

#!/usr/sfw/bin/wish8.3 -f
#
button .iostat -text iostat -command {fill_view iostat}
text .text
pack .iostat .text
proc fill_view u_cmd {
.text delete 1.0 end
set f [open "|$u_cmd 5 5 " r]
for {gets $f line} {![eof $f]} {gets $f line} \
{.text insert end $line\n}
close $f
}

Any help and the dufus would be greatful.


.