When checking the condition, you are using the $() construct, which expands to the output of the command line inside the brackets.
Code:
~/tmp$ egrep -v IamNOTaWORD /usr/dict/words | wc -l
25143
So when your grep expands to all the words in the dictionary! This output is passed as the arguments to '[' (aka test), which follows this rule:
Code:
~/tmp$ help test
...
STRING True if string is not empty.
...
Since the grep will give output for any string you give, the second condition is always true, and your loop never ends.
Here's something that seems to work
Code:
#!/bin/bash
read -p"Player one, enter a word: " word
while echo $word | egrep '[^a-z]' >/dev/null || ! egrep "^$word" /usr/dict/words >/dev/null; do
read -p"Word must contain lower-case letters only and be in the dictionary.. Try again: " word
done
Note that I've used the exit status of the grep commands rather than '[' on their output. The ">/dev/null" makes sure no output goes to the screen. Also an egrep -v with a non-word returns success because it finds lines that don't match the given pattern, so I dropped the -v and use ! to negate the return status.