Re: Debian bug #822605: SIGPIPE not handled in "echo >", terminates shell

2024-03-25 Thread Chet Ramey
On 3/22/24 2:02 AM, Gioele Barabucci wrote: 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

Re: Debian bug #822605: SIGPIPE not handled in "echo >", terminates shell

2024-03-22 Thread Gioele Barabucci
On 21/03/24 22:54, Chet Ramey wrote: 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 wrote: Regardless of the reason for the SIGPIPE, the reporter expects the loop to carry on indefinitely (`while true; ...`). Then

Re: Debian bug #822605: SIGPIPE not handled in "echo >", terminates shell

2024-03-21 Thread Chet Ramey
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 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

Re: Debian bug #822605: SIGPIPE not handled in "echo >", terminates shell

2024-03-21 Thread Chet Ramey
On 3/21/24 12:13 PM, Gioele Barabucci wrote: When bash runs a builtin command without forking, it should install a SIGPIPE handler that will cause that signal to abort the command but not terminate the shell. If this behavior is desired and not considered a bug, then the bash manual should

Re: Debian bug #822605: SIGPIPE not handled in "echo >", terminates shell

2024-03-21 Thread Gioele Barabucci
On 21/03/24 18:08, Oğuz wrote: On Thu, Mar 21, 2024 at 7:13 PM Gioele Barabucci 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

Re: Debian bug #822605: SIGPIPE not handled in "echo >", terminates shell

2024-03-21 Thread Oğuz
On Thu, Mar 21, 2024 at 7:13 PM Gioele Barabucci wrote: > The command in the first shell will exit after a random number of > iterations with "terminated with exit status 141". That's what every other shell does. > Regardless of the reason for the SIGPIPE, the reporter expects the loop > to

Debian bug #822605: SIGPIPE not handled in "echo >", terminates shell

2024-03-21 Thread Gioele Barabucci
Hi, I'm forwarding a bug report originally reported in . When a builtin function like echo fails to write to a named pipe, bash will receive a SIGPIPE that will terminate the whole shell. To reproduce this issue: In shell 1: $ rm -f /tmp/f && mkfifo