>&

Rudolf Floers r.floers at web.de
Thu Dec 28 18:04:10 PST 2000


> > Could you explain it a bit please? I spent a fair amout of time trying to 
> > construct something like this, but I figured it must have been impossible. I 

<snip>

thank you, matthias!

(1)

{ command 3>&1 4>&2 1>&4 2>&3 | tee error.log ; } 2>&1 main.log

does not work for me,

{ command 3>&1 4>&2 1>&4 2>&3 | tee error.log ; } &> main.log

however does work.


(2)

with the help of matthias' explanation i found that:

{ cmd 2>&1 1>&3 | tee stderr ; } 1> main 3>&1

works just as well. and it seems to be easier (at least to me).
that's how i'd explain it:

1>&3 directs cmd's stdout to fd #3
2>&1 directs cmd's stderr to fd #1 
fd #1 then is piped into tee 
tee writes to stderr and fd #1 again

fd #3 of the above "group" is merged with
the "group's" fd #1 and written to main. 

you need the {}s because fd #1 und fd #3 come from different commands.

what do think?

RF




-- 
Unsubscribe: send email to lfs-discuss-request at linuxfromscratch.org
and put unsubscribe in the subject header of the message




More information about the lfs-dev mailing list