help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: weird interaction between builtin cat and trap


From: Chet Ramey
Subject: Re: weird interaction between builtin cat and trap
Date: Mon, 18 Apr 2022 10:36:16 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.8.0

On 4/15/22 2:34 PM, Peng Yu wrote:

The `same behavior' here is dying due to SIGPIPE before checking for a
write error. Is that the hill you're dying on?

The point is that this error for builtin cat should be ignored.

So EPIPE should be ignored.

Another way to demonstrate the problem is the even simpler code. There
is no point to generate this kind of error. Otherwise, the external
cat would have done so already.

This is just another example of the same scenario. There's nothing new
here. You want SIGPIPE-before-write-error behavior and the builtin cat
doesn't do things in that order.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]