Code Library
Home Submit Free Hosting Link To Us Contacts

Bash Playing games with anagrams

Bash Playing games with anagrams Bash Bash Playing games with anagrams Download (.zip)



#!/bin/bash
# agram.sh: Playing games with anagrams.

# Find anagrams of...
LETTERSET=etaoinshrdlu

anagram "$LETTERSET" | # Find all anagrams of the letterset...
grep '.......' | # With at least 7 letters,
grep '^is' | # starting with 'is'
grep -v 's$' | # no plurals
grep -v 'ed$' # no past tense verbs
# Possible to add many combinations of conditions.

# Uses "anagram" utility
#+ that is part of the author's "yawl" word list package.
# http://ibiblio.org/pub/Linux/libs/yawl-0.3.tar.gz

exit 0 # End of code.

bash$ sh agram.sh
islander
isolate
isolead
isotheral






Bash Playing games with anagrams