2009-03-10, 01:54(-07), simonm: [...] > cat very_large_text_file | a | long | and | complex | chain | of | > pipes | tee <(command_one) <(command_two) 1>/dev/null > > So, I want to apply command_one and command_two to the whole output of > the resulting text stream coming from "pipes". > > Is there another way to do it, other than using tee, (very large) temp > files or (very large) variables? [...]
{ < very_large_text_file | a | long | and | complex | chain | of | pipes | tee >(command_one >&3) | command_two } 3>&1 Note that command_one and command_two will run in parallel and in bash or ksh93 (contrary to zsh), the shell will not wait for command_one, so it may still be running when that pipe line returns (though probably not for long if it stops after it see eof on its stdin). With zsh: ... of | pipes > >(command_one) > >(command_two) (zsh performs the tee internally here, that's the MUTL_IOS option). ~$ setopt multios ~$ echo foo > >(tr f F) > >(tr o O) Foo fOO -- Stéphane