<分区>
我想显示和比较 Bash 中单词“The”之后出现的所有单词。
示例:
The next generation will be ruled by the smartphones. The next thing is interesting to watch.The question is how do we solve this problem
所以预期的输出是:
next 2
smartphone 1
question 1
以下是我试过的命令:
cat file.txt | tr A-Z a-z |grep 'the ' | cut -d\ -f2| sort |uniq -c|sort -nr
但是这个命令并没有给我一个不准确的结果。它给我输出了单词“the”之后实际上不存在的单词