Another Unix Tip
How to count the instances of a given character in a file?
grep -c won't do it - instead it counts the number of maching lines. You need:
cat foo.c | tr -c -d ';' | wc -c
Which counts all the semicolons in
Unix - it's the OS that won't cop out when there's text all about! (source)