打印单词

例58

需求:打印文本出现最多的十个单词

#!/bin/bash
#这个脚本用来打印文本中单词最多的十个
#作者:xzm
#日期:2019-12-12
for w in `sed 's/[^a-zA-Z]/ /g' $1`
do
        echo $w
done  | sort | uniq -c | sort -n | head -10

你可能感兴趣的:(每天一个Shell脚本)