|
Home > Archive > Unix Shell > August 2007 > multiple pipes and tail -f
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
multiple pipes and tail -f
|
|
| pvsnmp@yahoo.com 2007-08-22, 1:23 pm |
| Hi,
I have been trying to do the following but it doesn't seem to work.
tail -f <filename> | grep <some string> | grep <some other string>
where <filename> is the name of any file to which new lines are added,
something like a log file for example.
Is there some restriction on the number of pipes which could be used
while using tail -f ?
I would like use sed instead of the last grep in the example above,
but for simplicity I have used second grep.
Thanks and Regards,
Prashant
| |
| Bill Marcum 2007-08-22, 1:23 pm |
| On Wed, 22 Aug 2007 08:53:07 -0700, pvsnmp@yahoo.com
<pvsnmp@yahoo.com> wrote:
>
>
> Hi,
> I have been trying to do the following but it doesn't seem to work.
> tail -f <filename> | grep <some string> | grep <some other string>
>
> where <filename> is the name of any file to which new lines are added,
> something like a log file for example.
> Is there some restriction on the number of pipes which could be used
> while using tail -f ?
> I would like use sed instead of the last grep in the example above,
> but for simplicity I have used second grep.
>
There is no limit, but the data may be buffered so that you won't see
any output until the buffers are full.
--
Type louder, please.
| |
| Cyrus Kriticos 2007-08-22, 7:23 pm |
| Bill Marcum wrote:
> On Wed, 22 Aug 2007 08:53:07 -0700, pvsnmp@yahoo.com
> <pvsnmp@yahoo.com> wrote:
> There is no limit, but the data may be buffered so that you won't see
> any output until the buffers are full.
Try:
tail -f <filename> | grep --line-buffered -e <some string> -e <some other
string>
--
Best | "Was bekommt man/frau, wenn man/frau Software kauft?
regards | Nichts außer einem Haufen Nullen und Einsen."
Cyrus | -- aus d. Lizenzvereinbarung von Spybot Search&Destroy
| |
| Cyrus Kriticos 2007-08-22, 7:23 pm |
| Bill Marcum wrote:
> On Wed, 22 Aug 2007 08:53:07 -0700, pvsnmp@yahoo.com
> <pvsnmp@yahoo.com> wrote:
> There is no limit, but the data may be buffered so that you won't see
> any output until the buffers are full.
Try:
tail -f <filename> | grep --line-buffered <some string> | grep
--line-buffered <some other string>
--
Best | "Was bekommt man/frau, wenn man/frau Software kauft?
regards | Nichts außer einem Haufen Nullen und Einsen."
Cyrus | -- aus d. Lizenzvereinbarung von Spybot Search&Destroy
| |
| pvsnmp@yahoo.com 2007-08-23, 1:21 am |
| On Aug 23, 1:34 am, Cyrus Kriticos <cyrus.kriti...@googlemail.com>
wrote:
> Bill Marcum wrote:
>
>
>
> Try:
>
> tail -f <filename> | grep --line-buffered <some string> | grep
> --line-buffered <some other string>
>
> --
> Best | "Was bekommt man/frau, wenn man/frau Software kauft?
> regards | Nichts au=DFer einem Haufen Nullen und Einsen."
> Cyrus | -- aus d. Lizenzvereinbarung von Spybot Search&Destroy
Hi,
Yes, this seems to work.
Thanks,
Prashant
|
|
|
|
|