WHy do we need both append and output directives?

Hi,

I was reviewing a shell script and I found this line:

yum -y update >> >(/usr/bin/tee /var/log/file)

I have tried removing the >> directive and all that will occur is that the file will be created--nothing gets put in the file. If I put back the >> directive it works. If I remove the > the line fails. Why are both >> and > required?

Thanks.

>( ... )

is process substitution.

I doubt this construct can be useful at all.
I even get strange behavior: after the command (yum -y update) is run, it takes one further command from stdin that is run but not passed to the >( ) .
Maybe a bug in bash.?
I would rewrite it

yum -y update | /usr/bin/tee /var/log/file

I wholeheartedly agree with MadeInGermany. This should be rewritten as a imple pipeline.

I am not sure about this but i suppose this is because output to stdout is buffered. Probably something is needed to either get the buffer full or some EOF marker to be placed in the output stream for the buffer to be flushed.

bakunin