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

Re: how to pipe to stdout and stderr



On [18/12/03 03:01 +0100], Andy Spiegl wrote:
> > <ibraheem@umarumohammed:~/try> ls foo bar > stdout 2> stderr
> 
> Thanks, but I don't want to redirect to 2 files, but pipe to 2 programs.
>  Andy.

Right, I get ya. Does this help:

[...]
<ibraheem@umarumohammed:~/try> ls
<ibraheem@umarumohammed:~/try> touch foo
<ibraheem@umarumohammed:~/try> ls
foo
<ibraheem@umarumohammed:~/try> ls foo bar >>(cat > stdout) 2>>(cat > stderr)
<ibraheem@umarumohammed:~/try> ls
foo	stderr	stdout
<ibraheem@umarumohammed:~/try> cat stdout
foo
<ibraheem@umarumohammed:~/try> cat stderr
ls: bar: No such file or directory
[...]


HTH,

			--ibz.
-- 



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