Count word frequencies in a text (Rated 0)Description:
Count the frequency of a particular word in a text file. Code starts here
#!/bin/sh
case $1 in
-[1-9]*) count=$1; shift;;
esac
cat $* |
tr -sc A-Za-z '\012' |
sort |
uniq -c |
sort -n |
tail ${count:--10}
Submitted by Devscripts on 27-02-2003 20:41 |