2010/4/1 Murali K. Vemuri <[email protected]>:
> On Wed, 2010-03-31 at 16:24 +0200, Denys Vlasenko wrote:
>
>> Why is this needed/useful?
>
> I have a board where I cannot add telnet and all I have is console.
> if fflush_all() were in its original position, my console refreshes
> every often and that is a problem as I might be doing something else on
> that console. this fflush_all() draws blank.
>
> currently if we mention "-t" , screen is flushed and new header is
> displayed. when we don't mention "-t", only blank screen is refreshed,
> time and again.
>
> So, when we mention "-t", watch does not dump anything on the terminal
> but every now and then re-flushes.

Yes, because you are using the wrong tool: you use watch as if it is
cron or runsv! Stop doing that.

-t only controls whether header will or will not be printed, but command's
output is always printed. I think your program prints nothing,
but watch still should display that "nothing", because that's what
watch is supposed to show - the output of the new command's invocation.

> re-flushing a screen on which this
> application does not actually dump anything ... does not sound good.

Yes, it does sound good.
watch _expects_ that the program will give some output.
Empty string is an output too.

>> > The user specifies the -t option only if he wants to do the "watch"
>> > silently. if the screen refreshes every often, does not look nice.
>>
>> Why do you think -t means "watch silently"?
>>
> If "-t" was not supposed to be the "silently" option, why does it not
> dump a header?

Because -t means "do not print the header", and nothing else!
It does not mean "do not clear the screen if program printed nothing",
as you seem to think. "watch -n5 -t true" should clear screen
every 5 seconds and then print output of "true" - empty string.

-- 
vda
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to