echo "Enter username" read $WORD if [[ "$WORD" =~ ^(Dale|Paul|Ray)$ ]]; then echo "$WORD is valid" else echo "$WORD is invalid" fi
O erro está no comando read , use read WORD em vez de read $WORD .
read
read WORD
read $WORD
Verifique isso:
echo "Enter username" read WORD if [[ "$WORD" =~ ^(Dale|Paul|Ray)$ ]]; then echo "$WORD is valid" else echo "$WORD is invalid" fi
Tags bash