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

Re: how to pipe to stdout and stderr



On Thu, 2003-12-18 at 00:12, Andy Spiegl wrote:
> Maybe I'm just too tired right now, but I can't find the solution how to
> pipe the standard output and standard error to 2 different programs.
> 
> Example:
>  program foo   (prints to stdout and stderr)
>   program bar1 should receive only stdout
>   program bar2 should receive only stderr
> 
> How can I do this?  Someone knows how to do that in bash, too?
[...]
<ibraheem@umarumohammed:~/try> ls
<ibraheem@umarumohammed:~/try> touch foo
<ibraheem@umarumohammed:~/try> ls foo bar
ls: bar: No such file or directory
foo
<ibraheem@umarumohammed:~/try> ls foo bar > stdout 2> stderr
<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