Listing Terms and Acronyms in Text or LaTeX using bash

I often need to check for inconsistent capitalization in my tex files. So listing all the consecutive capitalized words and characters helps me to decide which one is intentional capitalization and which one is not. The following bash script has two functions can lists all terms (Capitalized Phrase) and acronyms used throughout the input file.

1
2
3
4
5
6
7
8
9
10
$ terms filename.tex 
19 Cloud Station
9 Sensor Gateway
7 Sensor Cloud Infrastructure
...
$ acronyms filename.tex
34 VM
13 IaaS
13 CPU
...
Read more