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.
This commit is contained in:
parent
c6020cf1cd
commit
2fa8aab191
1 changed files with 8 additions and 4 deletions
10
redo-sh.do
10
redo-sh.do
|
|
@ -7,6 +7,10 @@ mkdir $1.new
|
||||||
GOOD=
|
GOOD=
|
||||||
WARN=
|
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 \
|
for sh in dash sh /usr/xpg4/bin/sh ash posh mksh ksh ksh88 ksh93 pdksh \
|
||||||
bash zsh busybox; do
|
bash zsh busybox; do
|
||||||
printf "%-30s" "Testing $sh..."
|
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: }
|
stripw=${line#warning: }
|
||||||
stripf=${line#failed: }
|
stripf=${line#failed: }
|
||||||
crash=$line
|
crash=$line
|
||||||
[ "$line" != "$stripw" ] && msgs="$msgs W$stripw"
|
[ "$line" = "$stripw" ] || msgs="$msgs W$stripw"
|
||||||
[ "$line" != "$stripf" ] && msgs="$msgs F$stripf"
|
[ "$line" = "$stripf" ] || msgs="$msgs F$stripf"
|
||||||
done <t/shelltest.tmp
|
done <t/shelltest.tmp
|
||||||
rm -f t/shelltest.tmp
|
rm -f t/shelltest.tmp
|
||||||
msgs=${msgs# }
|
msgs=${msgs# }
|
||||||
|
|
@ -59,5 +63,5 @@ elif [ -n "$WARN" ]; then
|
||||||
ln -s $WARN $3/sh
|
ln -s $WARN $3/sh
|
||||||
else
|
else
|
||||||
echo "No good shells found! Maybe install dash, bash, or zsh."
|
echo "No good shells found! Maybe install dash, bash, or zsh."
|
||||||
exit 1
|
exit 13
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue