This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problem with bash-3.0-9 (test)


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

According to Krzysztof Duleba on 7/26/2005 9:12 AM:
> Isn't this caused by the fact that bash returns $? when exits and Ctrl-C
> sets $? to 1? ksh, on the other hand, sets $? to 130 after Ctrl-C.

This is a bug in bash and ksh; POSIX requires $? to reflect the exit
status of the last executed pipeline, and does not allow the stty
interrupt character to change that when it is cancelling line editing.  I
have forwarded it to the upstream bash maintainer, but the ksh maintainer
may also want to report that bug.  zsh is correct in this regard.  What's
weird is that bash does have the correct information, in the $PIPESTATUS
array variable:

$ :
$ echo $? ${PIPESTATUS[*]}
0 0
$ :
$ [Ctrl-C]
$ echo $? ${PIPESTATUS[*]}
1 0
$ (exit 2)
$ echo $? ${PIPESTATUS[*]}
2 2
$ (exit 2)
$ [Ctrl-C]
$ echo $? ${PIPESTATUS[*]}
1 2

- --
Life is short - so eat dessert first!

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

iD8DBQFC5vA484KuGfSFAYARAlBHAJ90GlYfnKPZXRPQrPQCgoKd2Hi9+ACgl0Vs
Ab0qw/c6+tlCoWve/qelHIY=
=7RzL
-----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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]