Re: [Help-bash] stdout and stderr to two different process substitutions
From:
Pierre Gaston
Subject:
Re: [Help-bash] stdout and stderr to two different process substitutions
Date:
Wed, 25 Jan 2012 09:17:19 +0200
On Wed, Jan 25, 2012 at 9:00 AM, Peng Yu <address@hidden> wrote:
> Hi,
>
> prog >(gzip > xxx.gz) 2>(gzip > yyy.gz)
>
> I'm trying to direct stdin and stdout to two different process
> substitutions. But the syntax of 2> does not work. Â Does anybody know
> a way to do so? Thanks!
>( ) is more like $() than like a redirection.
If your try echo >() you will see that it is expanded to a filename.
In prog >(gzip > xxx.gz) you are not redirecting stdout, you are
passing an argument to prog
Thus to redirect stderr to it, you still need redirection:
prog 2> >(gzip >yyy.gz)