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

Re: Bug report + feature request



Sullivan N. Beck wrote:

> ...
> 
> Now for the feature request.  Since I'd actually like to separate and
> pipe STDOUT and STDERR separately to different commands (all of the
> above came about from various attempts to get this working) without
> resorting to fifos, intermediate files, etc., what I'd _really_ like to
> do is to be able to pipe different file descriptors similar to how I can
> redirect them to a file.  For example, I'd like to replace the following
> lines:
> 
>   COMMAND > /tmp/stdout 2> /tmp/stderr
>   cat /tmp/stderr | STDERR_COMMAND
>   cat /tmp/stdout | STDOUT_COMMAND
> 
> with the single line:
> 
>   COMMAND >| STDOUT_COMMAND 2>| STDERR_COMMAND
> 
> If this syntax isn't acceptable, that's fine with me.  Any syntax is
> fine.  I'd just like the functionality.

How should it find out if, in your example, STDERR_COMMAND should be
used for COMMAND or STDOUT_COMMAND?

But anyway... have you seen the >>(cmd) process substitution?
You can do:

  COMMAND >>(STDOUT_COMMAND) 2>>(STDERR_COMMAND)

or

  COMAMND 2>>(STDERR_COMMAND) | STDOUT_COMMAND

if you prefer.


Note to workers: in the info file, >>(foo) is shown as `> >(foo)'. Urgh.


Bye
 Sven


--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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