Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <42E6F038.3030107@byu.net> Date: Tue, 26 Jul 2005 20:23:52 -0600 From: Eric Blake User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) MIME-Version: 1.0 To: Krzysztof Duleba CC: cygwin AT cygwin DOT com Subject: Re: Problem with bash-3.0-9 (test) References: <42E53027 DOT 8050409 AT acm DOT org> <42E5351D DOT 4030700 AT byu DOT net> <42E638E1 DOT 2040806 AT byu DOT net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes -----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 AT byu DOT 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/