From b892f98fa96575fa93b0cc272f6c4398d0dd7eb5 Mon Sep 17 00:00:00 2001 From: mkalewski Date: Wed, 26 Sep 2012 16:14:23 +0200 Subject: [PATCH] Fixes a problem for counting warnings in a summary of problems ('+s' option). Now warnings are counted with the use of 'grep' command instead of 'wc'. Previously, '+s' option reported that there were warnings during compilation, even thought there weren't any warnings. --- pdflatex.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pdflatex.sh b/pdflatex.sh index 1baf587..8895c25 100755 --- a/pdflatex.sh +++ b/pdflatex.sh @@ -574,10 +574,10 @@ fi # Problems summary (part 1 of 2) if [[ -n $SHOWSUMMARY ]] ; then - ERRORSNUM=`grep -i "^\!" "$FILENAME".log | wc -l` + ERRORSNUM=`grep -c -i "^\!" "$FILENAME".log` ERRORS=`grep -A2 -i "^\!" "$FILENAME".log` WARNINGS=`grep -i warning "$FILENAME".log | grep -v -i infwarerr` - WARNINGSNUM=`echo "$WARNINGS" | wc -l` + WARNINGSNUM=`echo "$WARNINGS" | grep -c -i warning` fi # Cleanup