tobold.org

correct • elegant • free

△ comp.unix.shell △

◅ pipe stderr

Question from Kerninghan & Pyke's "THE UNIX PROGRAMMING ENVIRONMENT" ▻

pipe buffering in ksh?

In article <7n2bdt$2e5$1@nnrp1.deja.com>,  <mstargard@my-deja.com> wrote:
>I'm trying to modify the output of vmstat in real time, because I'd like
>to attach date stamps to each line (why doesn't vmstat have this?).

An existing solution is the `accustamp' and `tailocal' programs from the
daemontools package.

    http://pobox.com/~djb/daemontools.html

For example, you could use

    vmstat 5 |accustamp

to get numeric timestamps on each line, or

    vmstat 5 |accustamp |tailocal

to get human-readable ones.

In answer to your question: it's the tools approach!

Tim.
--
Tim Goodwin   | "You don't need to do drugs in order to
University of | think that the government's policies are
Leicester, UK | stupid and dangerous." -- David Bancroft

Original headers:

From: tjg@ltpcg.star.le.ac.uk (Tim J Goodwin)
Newsgroups: comp.unix.shell
Subject: Re: pipe buffering in ksh?
Date: 21 Jul 1999 11:44:26 +0100
Organization: University of Leicester, UK
Message-ID: <7n48b0$edb$1@ltpcg.star.le.ac.uk>
References: <7n2bdt$2e5$1@nnrp1.deja.com>

△ comp.unix.shell △

◅ pipe stderr

Question from Kerninghan & Pyke's "THE UNIX PROGRAMMING ENVIRONMENT" ▻