git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2] t0005: work around strange $? in ksh93 when program terminated by a signal

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Jul 12, 2010, 06:41 UTC
Message-ID
<4C3AB909.80205@viscovery.net>
In-Reply-To
<iOZX7rvipLDwT5DTYGPE0q9TlJfav09nJWqaRsyiefjNds9DpaDw1A@cipher.nrlssc.navy.mil>
From: Johannes Sixt <j6t@kdbg.org>

ksh93 is known to report $? of programs that terminated by a signal as 256 + signal number instead of 128 + signal number like other POSIX compliant shells. (ksh's behavior is still POSIX compliant in this regard.)

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Acked-by: Jeff King <peff@peff.net>
---
Am 7/9/2010 17:45, schrieb Brandon Casey:
> This may only be true for Ksh93.  The Ksh88 man page says that
> the exit status is 128+signum.  The Public domain Korn shell, and
> ksh on IRIX 6.5, Solaris 7, 9, and 10 all exit with the standard
> behavior of 128+signum.
Thanks for you input!
Hannes
 t/t0005-signals.sh |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/t/t0005-signals.sh b/t/t0005-signals.sh
index 09f855a..e17c96a 100755
--- a/t/t0005-signals.sh
+++ b/t/t0005-signals.sh
@@ -13,6 +13,7 @@ test_expect_success 'sigchain works' '
 	test-sigchain >actual
 	case "$?" in
 	143) true ;; # POSIX w/ SIGTERM=15
+	271) true ;; # ksh93 w/ SIGTERM=15
 	  3) true ;; # Windows
 	  *) false ;;
 	esac &&
-- 
1.7.1.585.gf3448
Previous: Brandon CaseyNext: Junio C Hamano
Message 8 of 9 in “t0005 failing with ksh93 on linux”
  1. Jonathan NiederJul 9, 2010
  2. t0005: work around strange $? in ksh when program terminated by a signalJohannes Sixt, Jul 9, 2010
  3. Jeff KingJul 9, 2010
  4. Jonathan NiederJul 9, 2010
  5. Brandon CaseyJul 9, 2010
  6. Ævar Arnfjörð BjarmasonJul 9, 2010
  7. Brandon CaseyJul 9, 2010
  8. t0005: work around strange $? in ksh93 when program terminated by a signalJohannes Sixt, Jul 12, 2010
  9. Junio C HamanoJul 12, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.