Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

RE: trouble with multiple pipes



> I am using zsh 3.0.5 on a 2.2.5 Linux kernel. I encountered a problem
> when trying to use multiple pipes with and a command that does not
> finish:
>
>   # tail -f foo
>   1
>   2
>   3
>   4
>   5
>   (pressed ^C to stop tail)
>
> Now I don't want to see all lines with a '5':
>
>   # tail -f foo | grep -v 5

I am surprised, that you get any output here. I don't get anything at all.
The problem is, that grep buffers input/output (I won't discuss, if it is a
bug or a feature). So, you won't see anything till the whole buffer is
filled. In my case grep does not do any write at all.

> Unfortunately I need to filter the output from a running
> daemon in this way, but I'm out of ideas.
>

What do you mean? If you need to write the continous output to a file - it
is O.K. As soon, as daemon fills up the whole buffer, it will be written
off.

/andrej



Messages sorted by: Reverse Date, Date, Thread, Author