It looks like the "grep" process is buffering for a pretty long time
before processing data. For instance, if you save that code to t.js,
and then do this:
touch nohup.out
node t.js > test-out.log &
while true ; do echo HEAD >> nohup.out ; done
then let that go for a few seconds, you'll probably find that
"test-out.log" gets one "grep" output for about every 3000 lines of
"HEAD" output. The only way that I can see to force grep to output
what's in its buffer is to kill the process, but of course, you want
the grep to keep running. I'm not sure why it seems to work just fine
by doing `tail -f nohup.out | grep HEAD`. Maybe something to do with
nonblocking stdio?
Unless you're using features very specific to grep, you might have an
easier time just filtering the log output in javascript.
> --
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To post to this group, send email to nod...@googlegroups.com.
> To unsubscribe from this group, send email to
> nodejs+un...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en.
>
--
You received this message because you are subscribed to the Google Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com.
To unsubscribe from this group, send email to nodejs+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nodejs?hl=en.