Bash is broken wrt trap :(

Eric Blake ebb9@byu.net
Wed Jun 27 12:03:00 GMT 2007


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

According to Richard A Nelson on 6/27/2007 12:48 AM:
> OS=AIX
> bash=3.00.16(1)-release
>
> OS=Linux      << RH EL WS 4 (Nahant)
> bash=3.00.15(1)-release

Just as I suspected.  You are comparing apples to oranges.  Until you run
bash 3.2 on all machines, you can't be sure that it was an intentional
upstream change between bash 3.0 and 3.2, rather than a cygwin-specific
compilation botch.

> However, the return trap is defined to execute in the context of the
> caller, after the called function has completed...   and since all it
> does is execute
> 'false', it does cause the parents ERR trap to trigger, and things go
> pretty smoothly (on some machines).

All that man bash says is "If a sigspec is RETURN, the command arg is
executed each time a shell function or a script executed with the . or
source builtins finishes executing".  It doesn't say whether the trap is
run in the context of the function or of the caller.  This is not
cygwin-specific - you will need to take your report upstream to the bash
maintainer.

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

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

iD8DBQFGglKd84KuGfSFAYARAm4/AJ44reipi6QeuQLXzzPaDVeEnqUWwgCcCtlo
DAnPuAhQe46y9zUNQO4vMMQ=
=ppDh
-----END PGP SIGNATURE-----

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list