capturing stdout and stderr to a pipe in ksh
Dick Tabor
tabor at wsl.dec.com
Wed Jun 12 11:18:50 AEST 1991
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
More information about the Comp.unix.shell
mailing list