Earlier, I wrote (excerpt from a much longer post):

>I find both of the following less than optimal:

>    1) That you have to do it twice to get it to exit (why twice?).
>    This is not a fluke or a one-off; it seems to be consistent.

>    2) That the bash shell crashes and doesn't handle it gracefully.

>Update: I realized while composing this that you probably need to trap
>SIGPIPE in the shell.

First, so far the responses to this thread fall into the category of: w/e

That said, I do think this is a bug - that in a proper language, this
would be handled, but we all know shell is far from a proper language.

A workaround for the bug is to use external echo instead of the shell
builtin:

    $ /bin/echo "This is a test" >&3

Now when the write fails, the shell process itself is not directly
involved.  The above command exits with status 141 and the program can
deal with it.  This also avoids having to deal with traps, which are
always messy.

Anyway, as they say, it is what it is...

=================================================================================
Please do not send me replies to my posts on the list.
I always read the replies via the web archive, so CC'ing to me is unnecessary.

When responding to my posts, please try to refrain from giving bureaucratic 
answers.
If you have nothing useful to say, then just click Next and go on.

Reply via email to