bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Coproc usage ... not understanding


From: Linda Walsh
Subject: Re: Coproc usage ... not understanding
Date: Tue, 09 Aug 2011 17:59:32 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.24) Gecko/20100228 Thunderbird/2.0.0.24 Mnenhy/0.7.6.666



Chet Ramey wrote:
On 8/9/11 8:19 PM, Linda Walsh wrote:
Linda Walsh wrote:
    I did think of that...but I thought when the foreground
process closes 'input', then all of the chained utils should see 'eof', and
should then flush their output...at least that was my belief in how they
"should" be working...(sigh)...
---
    Um...that got me to thinking..

    When you spawn off the coproc, and the parent has the I/O handles
to the child in COPROCNAME[0/1],   does the child have a copy of that as well?

The parent and child retain the appropriate ends of the pipe and close
the others.  The parent's copies are set close-on-exec.  Maybe that's the
problem.

In the parent, I used
exec "${parselast[1]}>&-"
shouldn't that have closed that last write-handle to the child?

(just before that, I did a "0<&${parselast[0]} cat & ", which I now realize
would have duped the handle I was trying to close, but if you set close-on-exec,
it shouldn't have been a prob....hmmmm...puzzlement!)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]