-
-
Save patrickelectric/b333936746a1299b149a34b779706c5c to your computer and use it in GitHub Desktop.
Sorts and counts all warnings from gcc compilation output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$#" != "1" ] | |
then | |
echo wrong number of arguments | |
echo Usage: $0 \<filename\> | |
echo filename - file with build output | |
exit 1 | |
else | |
cat $1 | grep "warning:" | sort | uniq -c | sort -nr | awk '{print $0}{total+=1}END{print "Total number of warnings:\n"total}' | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment