Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.unix.programmer > #614

Re: Tail -f with filter question

Newsgroups comp.unix.programmer
From Geoff Clare <geoff@clare.See-My-Signature.invalid>
Subject Re: Tail -f with filter question
References <4dd23b73$0$25748$c3e8da3$33881b6a@news.astraweb.com> <iqtguv$ef8$3@dont-email.me>
Date 2011-05-18 13:22 +0100
Message-ID <2aqca8-jps.ln1@leafnode-msgid.gclare.org.uk> (permalink)
Organization Zen Internet

Show all headers | View raw


Tobias Blass wrote:

> On 2011-05-17, Matt Charles <mcharles48@gmail.com> wrote:
>>
>> I've tried this:
>>
>> tail -f log.txt | grep -v INFO
>>
>> but I think that's buffering and I don't get to see the error messages
>> when they are produced (in real time).
>
> I found the following option for grep
>> --line-buffered Use line buffering on output.  This can cause a
>> performance penalty.
> I guess grep uses block buffering by default, so line buffering should solve
> your problem

The buffering is being done in tail, not grep.

The solutions given by others involve running tail with its output
going to a pseudo-terminal, using a tool that will read that output
from the master side of the pseudo-terminal and write it (without
buffering) to the pipe.

-- 
Geoff Clare <netnews@gclare.org.uk>

Back to comp.unix.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Tail -f  with filter question Matt Charles <mcharles48@gmail.com> - 2011-05-17 10:09 +0100
  Re: Tail -f  with filter question pk <pk@pk.invalid> - 2011-05-17 10:27 +0100
    Re: Tail -f  with filter question Mc <spam.mc@gmail.com> - 2011-05-17 10:55 +0100
      Re: Tail -f  with filter question pk <pk@pk.invalid> - 2011-05-17 11:04 +0100
  Re: Tail -f  with filter question Tobias Blass <tobiasblass@gmx.net> - 2011-05-17 09:59 +0000
    Re: Tail -f  with filter question scott@slp53.sl.home (Scott Lurndal) - 2011-05-17 14:08 +0000
      Re: Tail -f  with filter question Nobody <nobody@nowhere.com> - 2011-05-18 07:55 +0100
    Re: Tail -f  with filter question Geoff Clare <geoff@clare.See-My-Signature.invalid> - 2011-05-18 13:22 +0100
  Re: Tail -f  with filter question Damien Wyart <damien.wyart@free.fr> - 2011-05-17 16:36 +0200
    Re: Tail -f  with filter question James Waldby <not@valid.invalid> - 2011-05-17 18:22 +0000
      Re: Tail -f  with filter question Damien Wyart <damien.wyart@free.fr> - 2011-05-17 22:01 +0200

csiph-web