1 #!/bin/bash
2
3 while read line
4 do
5 for i in `seq 1 ${#line}`
6 do
7 a=`echo "${line}" | cut -c $i`
8 echo "${a}" >> res.txt
9 done
10 done < file
11
12
13 cat res.txt | sed -r 's/[ \t]+//g' | grep -v ^$ | sort | uniq -c | sort -nr
shell脚本之按字母出现频率降序排序。
最新推荐文章于 2021-05-14 11:26:42 发布