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

Re: command1 >>(command2)



On Mon, 20 Sep 2004, Atom 'Smasher' wrote:

> where is this documented?
> 	command1 >>(command2)

That whole form of redirection, you mean?  Look in "man zshexpn" or the 
info doc section on "process substitution".

> i've found that it's useful for duplicating stdout into multiple commands
> but there doesn't seem to be any control over whether command2 or command3
> finishes first.

That's correct.  The commands in the parens are run as background jobs, 
which means they finish in whatever order the OS schedules them (which is
probably mostly dependent on when they stop receiving input).  Zsh has to 
let them run independently or I/O might deadlock, so you can't control it
except possibly with something like

	command1 >>(command2;sleep 1) >>(command3;sleep 2)



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