写一个 bash 脚本以统计一个文本文件 words.txt
中每个单词出现的。
为了简单起见,你可以假设:
words.txt
只包括小写字母和 ' '
。示例:
假设 words.txt
内容如下:
the day is sunny the the the sunny is is
你的脚本应当输出(以词频降序排列):
the 4 is 3 sunny 2 day 1
说明:
1. 请不要在评论区发表题解!
2. 评论区可以发表关于对翻译的建议、对题目的疑问及其延伸讨论。
3. 如果你需要整理题解思路,获得反馈从而进阶提升,可以去题解区进行。
Shell 题目无需设置测试用例