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

Re: exec >& >(tee hello)



On 2013-03-28 at 08:46 -0700, Bart Schaefer wrote:
> On Mar 26,  3:21pm, Anthony Heading wrote:
> }
> } On zsh  (5.0 and 4.2.6 -   rhel5 x64),  this command hangs:
> }       zsh -c 'exec >& >(tee hello)'
> } It seems to work OK with bash.
> 
> Define "work".
> 
> Zsh is waiting for "tee hello" to finish.  It's part of the current
> command line, and nothing was put in the background, so the current
> command is in the foreground until all parts of it finish.  From a
> job management perspective this is the same as
> 
>     { exec >& } | tee hello
> 
> Perhaps
> 
>     exec >& >(tee hello &)

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.

-Phil



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