[comp.unix.shell] capturing stdout and stderr to a pipe in ksh

tabor@wsl.dec.com (Dick Tabor) (06/12/91)

I have a ksh script that invokes a C program.  When the C program core dumps
the message disappears.  The shell script captures all the output and sends it
via mail.  

(

print -u2  "testing to stderr"

foo  (the C program)

) | mail -s testing tabor

I have tried adding a 2>&1 after 'tabor' and before the |, however the core dump
message and the testing to stderr never get captured.

Thanks in advance for any help.

Dick Tabor