I'm putting the finishing touches on a shell I've written, and doing
so a query about signals came up.
It's generally the job of the shell to print abnormal termination
messages like "core dumped" and "segmentation violation". My shell
is no different. However, because I've seen the C shell report
broken pipes, whenever a process dies with SIGPIPE, my shell prints
"broken pipe" to the terminal. Unfortunately, broken pipes occur
more often than one would think. For example:
cat /usr/dict/words | sed 10q
causes cat to die with SIGPIPE.
My question is, does anyone know what the csh semantics are for
reporting a broken pipe; in other words, I'm looking for a reasonable
set of conditions under which to report a broken pipe, not just
when a sigpipe occurs.