Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [QUESTION] Inheritance of file descriptors in <( ... ) construct



On Fri, May 25, 2018 at 5:01 PM, dana <dana@xxxxxxx> wrote:
>
> I'm wondering about the following behaviour:
>
>   % ( fd=; exec {fd}>&2; : $( print foo >&$fd ) )
>   foo
>   % ( fd=; exec {fd}>&2; : =( print foo >&$fd ) )
>   foo
>   % ( fd=; exec {fd}>&2; : <( print foo >&$fd ) )
>   zsh: 12: bad file descriptor

This looks similar to the thread around workers/42708 ... except that
instead of not closing the descriptor created by <(...) we also need
to not close FDT_EXTERNAL descriptors when spawning <(...).

There doesn't seem to be any straightforward way to do this with the
current implementation of closem().



Messages sorted by: Reverse Date, Date, Thread, Author