From 3b940696c1eae4b415ebc73188b9470a15d47453 Mon Sep 17 00:00:00 2001 From: Avery Pennarun Date: Wed, 23 Mar 2011 11:24:17 -0700 Subject: [PATCH] redo-sh.do: prettier log messages. Make it easier to see which shells fail/warn about what. --- redo-sh.do | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/redo-sh.do b/redo-sh.do index 77a66de..761a162 100644 --- a/redo-sh.do +++ b/redo-sh.do @@ -9,7 +9,7 @@ WARN= for sh in dash sh /usr/xpg4/bin/sh ash posh mksh ksh ksh88 ksh93 pdksh \ bash zsh busybox; do - printf "Testing %s... " "$sh" + printf "%-30s" "Testing $sh..." FOUND=`which $sh 2>/dev/null` || { echo "missing"; continue; } # It's important for the file to actually be named 'sh'. Some @@ -20,14 +20,30 @@ for sh in dash sh /usr/xpg4/bin/sh ash posh mksh ksh ksh88 ksh93 pdksh \ ln -s $FOUND $1.new/sh set +e - ( cd t && ../$1.new/sh shelltest.od >/dev/null 2>&1 ) + ( cd t && ../$1.new/sh shelltest.od >shelltest.tmp 2>&1 ) RV=$? set -e + msgs= + crash= + while read line; do + #echo "line: '$line'" >&2 + stripw=${line#warning: } + stripf=${line#failed: } + crash=$line + [ "$line" != "$stripw" ] && msgs="$msgs W$stripw" + [ "$line" != "$stripf" ] && msgs="$msgs F$stripf" + done