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

Re: exec >& >(tee hello)



On Thu, Mar 28, 2013 at 2:57 PM, Phil Pennock <
zsh-workers+phil.pennock@xxxxxxxxxxxx> wrote:

> Okay, now I'm confused.
>
> See, this works:
>
>   zsh -c 'exec > >(tee hello); echo foo'
>   zsh -c 'exec > >(tee hello)'
>
> It's only when you try to use >& to redirect both stdout and stderr that
> it fails/hangs.
>

> >(...) is parsed as its own syntactic element that semantically means
/connect to a process on a real pipe/.

>& >(...) is two elements, /join stdout with stderr/ and /connect to a
process on a FIFO/.  It only avoids being a syntax error because >(...) is
replaced by a file name to which >& can redirect.

So you're seeing the difference between pipe and FIFO behavior.


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