ls -al | tee >(cat) | gzip -c
cat /proc/`pidof program`/fd/2
(change to your needs, stdin==1, stdout==2, stderr=3)
(change to your needs, stdin==1, stdout==2, stderr=3)