From 2fa8aab1913e10457a2f7f1f6ec007139b437e55 Mon Sep 17 00:00:00 2001 From: Avery Pennarun Date: Sun, 8 May 2011 01:25:26 -0400 Subject: [PATCH] redo-sh: reverse a case that caused 'set -e' to abort on zsh. Correctly, I might add. It's too bad none of my other shells did it. Sigh. --- redo-sh.do | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/redo-sh.do b/redo-sh.do index 9d50bbd..0140e4d 100644 --- a/redo-sh.do +++ b/redo-sh.do @@ -7,6 +7,10 @@ mkdir $1.new GOOD= WARN= +# Note: list low-functionality, maximally POSIX-like shells before more +# powerful ones. We want weaker shells to take precedence, as long as they +# pass the tests, because weaker shells are more likely to point out when you +# use some non-portable feature. for sh in dash sh /usr/xpg4/bin/sh ash posh mksh ksh ksh88 ksh93 pdksh \ bash zsh busybox; do printf "%-30s" "Testing $sh..." @@ -31,8 +35,8 @@ for sh in dash sh /usr/xpg4/bin/sh ash posh mksh ksh ksh88 ksh93 pdksh \ stripw=${line#warning: } stripf=${line#failed: } crash=$line - [ "$line" != "$stripw" ] && msgs="$msgs W$stripw" - [ "$line" != "$stripf" ] && msgs="$msgs F$stripf" + [ "$line" = "$stripw" ] || msgs="$msgs W$stripw" + [ "$line" = "$stripf" ] || msgs="$msgs F$stripf" done