Dotfiles, utilities, and other apparatus.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

17 lines
500 B

#!/bin/sh
# https://mspsocial.net/@earthtopus/103286059506297173
echo "original letter frequency:"
grep -o . pangram.txt | tr -d '[:punct:]' | grep -v "^\s*$" | tr '[:upper:]' '[:lower:]' | sort | uniq -c | sort -rn
echo
echo "lightly golfed:"
grep -oE '[[:alpha:]]' pangram.txt | tr '[:upper:]' '[:lower:]' | sort | uniq -c | sort -rn
echo "original letter-only character count:"
cat pangram.txt | tr -cd '[:alpha:]' | wc -m
echo
echo "lightly golfed:"
tr -cd '[:alpha:]' < pangram.txt | wc -m