Old high school files. Lessson notes/codes/projects etc.
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.
hsf/prog2/wordle/thing.sh

17 lines
420 B

3 years ago
#!/usr/bin/bash
3 years ago
words=/usr/share/dict/words
3 years ago
if [ -z "$2" ]
then
echo "Usage: $ thing.sh (lower bound) (upper bound)"
echo "Example: $ thing.sh 0 1"
echo "The above example will output the best words that match first and second characters."
exit
fi
3 years ago
thing=$(ruby calc.rb $1 $2)
3 years ago
fivewords=$(cat $words | awk '{print tolower($0)}' | grep -E '^[[:alpha:]]{5}$')
3 years ago
echo $fivewords | sed 's/ /\n/g' | grep -E "^${thing}"