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

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