Issue
I need to count how many uppercase letters there are in a word. How can I do this?
id='dv4'>
Solution
I like tr for this:
echo "$word" | tr -dc A-Z | wc -c
simply delete all characters that are not uppercase and count what is left.
You might prefer tr -dc [:upper:]
, but I find A-Z easier to use.
Answered By - William Pursell Answer Checked By - Marilyn (WPSolving Volunteer)