On Tue, 30 Jul 2002, Michael O'Donnell wrote:

=>
=>Today I ran across this usage of the 'Process Substitution' trickery
=>supported by BASH:
=>
=>
=> { command1 ; command2 ; command3 } > >( tee -a $someLogFile ) 2>&1
This doesn't look legal. Period.
=>
=>
=>...and wondered how it differs from (or is preferable to) this:
=>
=>
=> { command1 ; command2 ; command3 }  | ( tee -a $someLogFile ) 2>&1
This is also illegal unless you are running a really old version of bash. 
The last cmd inside the braces needs to be terminated by a semicolon:

{ command1 ; command2 ; command3; }  | ( tee -a $someLogFile ) 2>&1

The tee command is being executed inside a subshell for no good reason 
that I can discern and the stderr of the tee is duped to stdout, except 
that tee produces nothing to stderr.
Also note that > > is not a legal parse. If you're going to append to a 
file, you must use the two angle brackets together: >>

=>
=>
=>Probably some subtle named-pipe versus unnamed-pipe difference, ya?
=>
=>
=>If you haven't messed with this 'Process Substitution' stuff
=>before, examples like the following could (as my favorite oracle
=>might say) "bake your noodle":
=>
=>  ls -l <( echo  )
=>  echo  <( ls -l )
=>
=>...my noodle is currently al dente.  (I mean, all denty...)

-- 
-Time flies like the wind. Fruit flies like a banana. Stranger things have -
-happened but none stranger than this. Does your driver's license say Organ
-Donor?Black holes are where God divided by zero. Listen to me! We are all-
-individuals! What if this weren't a hypothetical question? [EMAIL PROTECTED]



*****************************************************************
To unsubscribe from this list, send mail to [EMAIL PROTECTED]
with the text 'unsubscribe gnhlug' in the message body.
*****************************************************************

Reply via email to