ok. Take a look at the following bash script. You may have to modify it to suit your requirements, and it doesn't use pipes,etc (hence requires temporary files to be created).
Code:
#! /bin/bash
if ((test -z $1) || !(test -e $1))
then
exit
fi
sort $1 > /tmp/top10.tmp
uniq -c /tmp/top10.tmp > /tmp/top10.tmp2
sort -r /tmp/top10.tmp2 > /tmp/top10.tmp
# remove the "| cut -f 2" part to display frequency numbers
head -10 /tmp/top10.tmp | cut -f 2