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

Re: how to pipe to stdout and stderr



On Thursday 18 December 2003 00:01, 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.

Use mkfifo, maybe?

hisham@aria ~/test] mkfifo err
hisham@aria ~/test] mkfifo out

hisham@aria ~/test] cat out | tac > out.txt &
hisham@aria ~/test] cat err | tr '[:lower:]' '[:upper:]' > err.txt &
hisham@aria ~/test] ls * zzz > out 2> err

hisham@aria ~/test]cat err.txt
LS: ZZZ: NO SUCH FILE OR DIRECTORY

hisham@aria ~/test] ls -1
err
err.txt
out
out.txt

hisham@aria ~/test] cat out.txt
out.txt
out
err.txt
err

-- 
Hisham Muhammad
"...and this is the first step."



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