FunctionRacerProblemsRace

Word Count Table

HardBasha shell script

Count how often each word appears in text.txt. A word is a run of letters, and capitals count the same as small letters. Print one line per word, in small letters, as the word, a space and its count: the most common first, and words with the same count in alphabetical order.

Example 1

text.txt
The cat saw the dog.
The dog ran!
prints
the 3
dog 2
cat 1
ran 1
saw 1

Constraints

Race itor take your time

Write it in your browser, against the clock. The model script, with a note on each command it uses, comes after.

More Bash problems