[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Debian bug #822605: SIGPIPE not handled in "echo >", terminates shel
From: |
Chet Ramey |
Subject: |
Re: Debian bug #822605: SIGPIPE not handled in "echo >", terminates shell |
Date: |
Thu, 21 Mar 2024 17:54:17 -0400 |
User-agent: |
Mozilla Thunderbird |
On 3/21/24 1:43 PM, Gioele Barabucci wrote:
On 21/03/24 18:08, Oğuz wrote:
On Thu, Mar 21, 2024 at 7:13 PM Gioele Barabucci <gioele@svario.it> wrote:
Regardless of the reason for the SIGPIPE, the reporter expects the loop
to carry on indefinitely (`while true; ...`).
Then he should do `trap '' PIPE' before the loop.
it is incorrect that > SIGPIPE terminates the subshell.
Why?
For various reasons. First of all, because it confuses users (there are
various bug reports in Debian for this specific issue).
More technically, because non-builtin commands are treated differently, for
example /bin/echo (from <https://bugs.debian.org/423207>):
There's been a fair amount of (inconclusive) discussion on the POSIX
mailing list about this issue at various points, but not enough reason
to change the way bash has always behaved.
For example, there is plenty of code that expects the shell to exit when
you hit it with, say, a SIGHUP while it's executing a builtin, or if you
hit a non-interactive shell with a SIGTERM during a builtin, because that's
how shells have always behaved.
--
``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/
OpenPGP_signature.asc
Description: OpenPGP digital signature
Re: Debian bug #822605: SIGPIPE not handled in "echo >", terminates shell, Chet Ramey, 2024/03/21