Word frequency: Difference between revisions

Content deleted Content added
m Swift - reduce memory usage
Line 4,365:
This is derived from Doug McIlroy's original 6-line note in the ACM article cited in the task.
<lang bash>#!/bin/sh
cat <"${1} |" tr -cs A-Za-z '\n' | tr A-Z a-z | LC_ALL=C sort | uniq -c | sort -rn | sedhead -n "${2}q"</lang>