Re: Getting timed output to display.
- From: claird@xxxxxxxxx (Cameron Laird)
- Date: Wed, 04 Jan 2006 02:08:02 GMT
In article <ZPCuf.246730$0l5.198190@dukeread06>,
Gerald W. Lester <Gerald.Lester@xxxxxxx> wrote:
>Cactus Paul wrote:
>> 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.
>
>Read the man/help page on fileevent.
>
>Also search wiki.tcl.tk for information.
>
There are platform specificities that make a precise answer
difficult. As a first experiment, though, change
.text insert end $line\n
to
.text insert end $line\n
update
Does that appear to bring you closer to what you want?
.
- Follow-Ups:
- Re: Getting timed output to display.
- From: Cactus Paul
- Re: Getting timed output to display.
- References:
- Getting timed output to display.
- From: Cactus Paul
- Re: Getting timed output to display.
- From: Gerald W. Lester
- Getting timed output to display.
- Prev by Date: Re: set character at string position
- Next by Date: Re: set character at string position
- Previous by thread: Re: Getting timed output to display.
- Next by thread: Re: Getting timed output to display.
- Index(es):