RosettaCodeData/Task/Word-frequency/UNIX-Shell/word-frequency-1.sh

3 lines
100 B
Bash
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
#!/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"