I'm trying to get the number of matches (in this case occurrences of
}) in each line of a .tex file.
I know that the
-o flag returns only the match, but it returns each match on a new line, even combined with the
-n flag. I don't know of anything I could pipe this through to count the repeats. The
-c flag only returns the total number of matches in the entire file - maybe I could pipe one line at a time to grep?