RosettaCodeData/Task/Word-frequency/UNIX-Shell/word-frequency-1.sh
2023-07-01 13:44:08 -04:00

2 lines
100 B
Bash

#!/bin/sh
<"$1" tr -cs A-Za-z '\n' | tr A-Z a-z | LC_ALL=C sort | uniq -c | sort -rn | head -n "$2"