Re: Confused by unexpected redirection behavior when using the watch command



On Oct 9, 11:17 am, Icarus Sparry <use...@xxxxxxxxxxxxxxxxx> wrote:
On Thu, 09 Oct 2008 08:33:09 -0700, swordsaintzero wrote:
This is in GNU bash, version 2.05b.0(1)-release .

Using the watch command to update (something along the lines of)

watch "lsof -i | grep -i estab" >> watch.log

Doesn't give me the expected behavior I tried &>> and still don't get
the expected output.

What I am expecting is each time watch updates there is new data on the
screen to write out, and this would be appended to the file. I know it's
probably something simple but after a few hours and a lot of googling
still no love.

Also I am aware that I could use a loop rather than watch, but darn it I
really want to know what watch itself isn't doing what I asked is it
something to do with the way that watch prints to screen?  I can pipe
it's output to grep so I am surprised I can't simply pipe it to a text
file.

Thanks in advance for any help.

Which "watch" program?

Are you sure that this is not just a buffering issue, i.e. so few new
connections are being established that the output is not changing enough
for the output bffer (typically 4k) to need to be flushed?
If you have "unbuffer" or "pty" on your system you could try running the
command under that, or run the command without the redirection inside
"screen" and let screen do the logging.

I wasn't even aware that there was a size limit needed to flush buffer
< so no I am not sure if it is a buffering issue or not. Thanks for
that at least I learned something!
I will check out unbuffer and pty and report back with my findings.
The watch program
watch -v
procps version 2.0.13

So apparently its part of a bundle of small useful utilities like top,
vmstat, free, kill etc.

Just checked and unfortunately these locked down systems (can't
install software) don't have pty or unbuffer.
If you have watch on your system can you just try to pipe it's output
to a file and let me know if you think it's the buffering issue?

Thanks in advance.
.



Relevant Pages

  • buffering / streaming problem can not watch a video
    ... I'm having a terrible time with streaming or buffering. ... not have this problem but now I can't watch any video for more than ...
    (microsoft.public.windows.vista.performance_maintenance)
  • WMP10 barely playing MLB.TV MLB games: constant buffering
    ... I am trying to watch the videos of baseball games from the MLB.COM ... they are unwatchable because of constant buffering. ... current download speed prior to this post was 1350. ...
    (microsoft.public.multimedia.windows.mediaplayer)
  • Constant buffering during MLB.TV streams. Connection is fine.
    ... I am trying to watch the videos of baseball games from the MLB.COM ... they are unwatchable because of constant buffering. ... current download speed prior to this post was 1350. ...
    (microsoft.public.windowsmedia.player)
  • buffering vs...
    ... I have broadband and at times when I watch a repeat of a show on the ... networks site, it runs smoothly without being pestered with buffering. ...
    (rec.video.desktop)
  • Re: Evenings Pleasures May 19th 2009
    ... Just home from supper out with my two sons and the lovely Mrs. Clemons at ... At the First Bell of the First Watch in Port Clinton - where Great Black ... It's my first pipe since Monday morning. ... You ever have a Swiss watch?" ...
    (alt.smokers.pipes)