Re: adding leading characters to stdout

From: William Park (opengeometry_at_yahoo.ca)
Date: 04/29/04


Date: 29 Apr 2004 05:31:34 GMT

SeungSeop, Park <sspark@hi.snu.ac.kr> wrote:
> Hi.
> I want to organize the output of a program such that sub-program's
> outputs start with some leading charactors :
> -------------------------------------
> :
> normal program output comes here
> :
> :
> >
> > sub-program outputs start with ' >' characters
> >
> --------------------------------------
>
> To do that, i made a shell scripts :
> -------------------------
> # /bin/sh
> ...
> noraml_prog
> ...
> sub_prog 2>&1 | sed -e 's/^/ >/'
> ...
> ---------------------------
> This works. But, because a pipe buffers the output of a program, there
> are long delays before I can see any output.
>
> Is there any idea??

'read' does not buffer. But, it is slow.

-- 
William Park, Open Geometry Consulting, <opengeometry@yahoo.ca>
Linux solution/training/migration, Thin-client


Relevant Pages

  • Re: adding leading characters to stdout
    ... sspark@hi.snu.ac.kr (SeungSeop, Park) wrote: ... > outputs start with some leading charactors: ... i made a shell scripts: ...
    (comp.unix.shell)
  • adding leading characters to stdout
    ... outputs start with some leading charactors: ... normal program output comes here ... But, because a pipe buffers the output of a program, there ... are long delays before I can see any output. ...
    (comp.unix.shell)