On 4/13/16 1:13 AM, George wrote:
> Users can work around this by duplicating the file descriptor:
> $ exec {fd_that_wont_vanish_on_me}<&${coproc[0]}-
> But it kind of negates the benefit of having coproc accept a name for
> the fd array if you just wind up having to re-bind it anyway. And the
> command could still fail if it's not run immediately after launching
> the coproc.
>
> Thus, I think coproc shouldn't close its file descriptors or erase its
> environment variables.
This an interesting suggestion. I will look at it for a future version.
You have to be careful with writing to a pipe where the reader has gone
away, though, since that will generate SIGPIPE.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU [email protected] http://cnswww.cns.cwru.edu/~chet/