bug-bash
[Top][All Lists]
Advanced

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

Re: Bash exits with "Broken pipe" with process subsitution and sleep


From: Andreas Schwab
Subject: Re: Bash exits with "Broken pipe" with process subsitution and sleep
Date: Sun, 31 Aug 2025 21:11:23 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

On Aug 31 2025, Maria wrote:

>       When I redirect the output of a command that sleeps into a process
>       substitution with a process that finishes immediately (like "echo" or
>       a process that doesn't exist), after the first sleep, Bash will crash
>       with exit code 141.

This is not a crash, it is normal behaviour in presence of a signal.
You can replace the shell command with any program that produces enough
output, you will get exactly the same behaviour.

$ yes > >(:); echo $?
141
$ yes | :; echo ${PIPESTATUS[*]}
141 0

(141 is 128 + SIGPIPE.)

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."



reply via email to

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