On 2/23/19 11:32 PM, Pádraig Brady wrote: >>>> You HAVE to use some other intermediate program if you want to override >>>> an inherited ignored SIGPIPE in sh into an inherited default-behavior >>>> SIGPIPE in sort. >>> >>> Should we also propose to POSIX to allow trap to specify default? >> >> That's what "trap - PIPE" is already supposed to do, except that POSIX >> has the odd requirement that a signal that was inherited ignored cannot >> be reset to default. >> >>> Maybe `trap 0 PIPE` or similar? >> >> Alas, bash has already defined that to mean the same as 'trap - EXIT PIPE'. > > Fair enough, but do we agree that it would be good > to have functionality in the shell with some similar syntax > that resets the handler to system default?
Worth asking on the bash list to see if Chet has any interest in such an extension (POSIX is reluctant to specify something that doesn't have existing implementation practice). -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org