-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Bruno Haible on 1/1/2009 5:09 PM:
> After 'trap - SIGPIPE', sed should get a fatal SIGPIPE signal in these 
> conditions.
> Quoting 
> <http://www.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#trap>
> 
>   "If action is '-' , the shell shall reset each condition to the default 
> value."

You're missing one other piece.

"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."

Therefore, if a bash script is started while SIGPIPE is already ignored,
there is nothing the script can do to turn it off ('trap - SIGPIPE' only
re-enables default behavior if your script was the one that disabled it in
the first place, but not if your script started with it already disabled).

- --
Don't work too hard, make some time for fun as well!

Eric Blake             e...@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkldXvAACgkQ84KuGfSFAYBF3ACfTMvLONUhuapQRc3fV2hG6Ojl
b1IAnRyQzLTTusDmHKaJK+P0YtDgm6xT
=2AHO
-----END PGP SIGNATURE-----


Reply via email to