#! /bin/zsh # # this file: # https://dataswamp.org/~incal/conf/.zsh/freq words () { tr 'A-Z' 'a-z' | sed -E 's/[ \t]+/\n/g' | sed -e 's/[^0-9a-z]//g' -e '/^$/d' | sort | uniq -c | sort -n -r -S 50M } wf () { local word=$1 local freqf=$2 awk "/\<$word\>/{print \$1}" $freqf }