企业Shell面试题18:单词及字母去重排序案例

企业Shell面试题18:单词及字母去重排序案例_第1张图片
wKiom1XW4BagvgPxAAC_N_Bdskw467.jpg

1、按单词出现频率降序排序!
2、按字母出现频率降序排序!
the squid project provides a number of resources to assist users design,implement and support squid installations. Please browse the documentation and support sections for more infomation
解答:
[root@oldboy ~]# cat oldboy.txt 
the squid project provides a number of resources to assist users design,implement and support squid installations. Please browse the documentation and support sections for more infomation

按单词排序解答:

法1:
[root@oldboy scripts]# tr ",." " " 

你可能感兴趣的:(企业Shell面试题18:单词及字母去重排序案例)