[PATCH] t0005: work around strange $? in ksh when program terminated by a signal
- From
Johannes Sixt <j.sixt@viscovery.net>
- Date
- Jul 9, 2010, 07:05 UTC
- Message-ID
- <4C36CA2C.5050305@viscovery.net>
- In-Reply-To
- <20100709030812.GA16877@dert.cs.uchicago.edu>
From: Johannes Sixt <j6t@kdbg.org>
ksh 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> --- Am 7/9/2010 5:08, schrieb Jonathan Nieder:
Show 11 quoted lines
> I can’t seem to get test-sigchain to run with ksh93 on linux: > > $ ksh > > ksh>$ ../bin-wrappers/test-sigchain > three > two > one > Terminated > ksh>$ echo $? > 271
ksh is not wrong, just strange. See http://www.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_08_02 (last sentence).
-- 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..93e58c0 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 ;; # ksh w/ SIGTERM=15 3) true ;; # Windows *) false ;; esac &&
-- 1.7.1.585.gf3448