Advanced shell scripting question :-)

Bob Bell bobbell at zk3.dec.com
Thu Sep 5 14:02:56 EDT 2002


On Thu, Sep 05, 2002 at 01:29:18PM -0400, Derek D. Martin <ddm+gnhlug at pizzashack.org> wrote:
> What I'm wondering is: there's got to be a way to do this, such that
> the output is syncronized to the order of the input, doesn't there?
> The operating system does (more or less) this all the time, whenever
> it sends stdout and stderr to your terminal.

    Ah, but there the difference is that you have a single process
doing the writing.  Therefore, the write() syscalls are serialized and
can be processed in order.  As I outlined in my email (which you
probably hadn't read yet), the key difference in Steven's case is that
he wants to selective duplicate the output of the program, which AFAIK
requires another program to do so.

> Any I/O gurus out there know by what mechanism this could be achieved?
> I'm now very curious...  It seems to me this probably not the only
> sort of application where you might want to process the input from
> several descriptors in the order it was received.

    Disclaimer: IANAIOG (I am not an I/O guru)

-- 
Bob Bell <bobbell at zk3.dec.com>
-------------------------------------------------------------------------
 "Testing shows the presence, not the absence, of bugs."
   -- Edsger W. Dijkstra, University of Texas



More information about the gnhlug-discuss mailing list