From: Ben Pfaff Date: Tue, 21 Jun 2005 04:08:53 +0000 (+0000) Subject: Deal with `wc -l' putting spaces in the output. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=20630c2f10486b46f8666bc5b50eccbcb9614854;p=pintos-anon Deal with `wc -l' putting spaces in the output. --- diff --git a/src/tests/Make.tests b/src/tests/Make.tests index 00b9097..44e8d5e 100644 --- a/src/tests/Make.tests +++ b/src/tests/Make.tests @@ -26,13 +26,13 @@ grade:: results check:: results @cat $< - @COUNT="`egrep '^(pass|FAIL) ' $< | wc -l`"; \ - FAILURES="`egrep '^FAIL ' $< | wc -l`"; \ - if [ "$$FAILURES" = 0 ]; then \ - echo "All $$COUNT tests passed."; \ - else \ - echo "$$FAILURES of $$COUNT tests failed."; \ - exit 1; \ + @COUNT="`egrep '^(pass|FAIL) ' $< | wc -l | sed 's/[ ]//g;'`"; \ + FAILURES="`egrep '^FAIL ' $< | wc -l | sed 's/[ ]//g;'`"; \ + if [ $$FAILURES = 0 ]; then \ + echo "All $$COUNT tests passed."; \ + else \ + echo "$$FAILURES of $$COUNT tests failed."; \ + exit 1; \ fi results: $(RESULTS)