help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] When pipes fail (and when not)


From: Eric Blake
Subject: Re: [Help-bash] When pipes fail (and when not)
Date: Wed, 28 Nov 2018 06:54:07 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0

On 11/28/18 6:15 AM, Paul Wagner wrote:
On 27.11.2018 19:03, Chet Ramey wrote:
If bash starts up with a signal ignored, you can't install a trap for it or reset its disposition to SIG_DFL. You have to fix the problem at its root.

Thanks for pointing that out.

I still don't understand why setting the trap on a system that has SIGPIPE vital doesn't work, so I'd be very greatful for any hints.

It's a lame restriction from POSIX based on historical practice (that I _really_ wish we weren't stuck with): http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#trap

"Signals that were ignored on entry to a non-interactive shell cannot be trapped or reset, although no error need be reported when attempting to do so. An interactive shell may reset or catch signals ignored on entry. Traps shall remain in place for a given shell until explicitly changed with another trap command."

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org



reply via email to

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