Advertisement
Guest User

Untitled

a guest
Aug 31st, 2015
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. # We own a set of alphabet blocks. There are 24 of them: one letter on each
  2. # (with drawings of things that start with that letter), and X, Y, and Z are all
  3. # on one block. We took the letters for our daughters name (no repeats, phew!)
  4. # and they sit on a shelf in her room. The rest are with her toys in the living
  5. # room.
  6. #
  7. # Here's how I figured out the longest words I could spell with the remaining
  8. # blocks (buchwald, plutarch, abruptly, upwardly, watchful, and wrathful).
  9.  
  10. cat $WORDFILE | # Replace with a word file on your machine, probably one in /usr/share/dict/ \
  11. tr '[A-Z]' '[a-z]' | # Convert all to lowercase \
  12. grep -v '[removedword]' | # Remove words that contain the letters from a word \
  13. grep -v '\(.\).*\1' | # Remove words with one letter more than once \
  14. grep -v '[xyz].*[xyz]' | # Remove words with more than one of [xyz] \
  15. awk '{ print length, $0 }' | sort -n -s -r | cut -d" " -f2- | # Sort by length \
  16. head -20 # Just show the top 20
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement