On Thu, Jul 5, 2012 at 2:26 PM, Stefan Karpinski <
ste...@karpinski.org> wrote:
> In general, Julia's command execution is far more careful (aka
> finicky) when it comes to termination status of subprocesses than the shell
> or other programming languages.
I very much agree that this is the Right Thing in general, but I also
strongly believe that SIGPIPE should be treated as normal termination.
Pipes are essentially a form of lazy data stream connecting two
coroutines, in which the consumer resumes the producer when it needs
more input. If the consumer chooses not to read from the producer,
this ought not to be treated as a fault in the producer, which is what
any other sort of signal would mean. The reason for SIGPIPE to happen
at all is to prevent useless processes from hanging about with nowhere
to send their output to.
In particular, using ignorestatus on any occasion when the consumer
*might* terminate spontaneously without reading all of its input ("sed
q" is just one such case), which in principle can mean *any* process
that writes to a pipe, will wind up masking actual errors (the best is
the enemy of the good). It should be possible to determin that a
SIGPIPE has occurred, of course, but it should not propagate an error
into the controlling process.
--
GMail doesn't have rotating .sigs, but you can see mine at
http://www.ccil.org/~cowan/signatures