adding leading characters to stdout

From: SeungSeop, Park (sspark_at_hi.snu.ac.kr)
Date: 04/29/04

  • Next message: William Park: "Re: adding leading characters to stdout"
    Date: 28 Apr 2004 22:11:39 -0700
    
    

    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??


  • Next message: William Park: "Re: adding leading characters to stdout"