Why is bash telling me 'y' is not equal to 'y'?Code:flamingo:~ joliver$ cat test.sh
#!/bin/sh
case $UID in
0 ) echo "You are running as superuser, good." ;;
[0-9] | [0-9][0-9] | [1-4][0-9][0-9] ) echo "Should you be running as UID < 500?" ;;
* ) echo "Regular user, proceed?"
while [ "$ANS" != [yY] ] || [ "$ANS" != [Nn] ]
do
read -n 1 -s ANS
echo $ANS
case $ANS in
[yY] ) echo "OK, continuing!" ;;
[nN] ) echo "OK, exiting"; exit 0 ;;
* ) echo "Press Y or N please" ;;
esac
done ;;
esac
echo "This is the end!"
flamingo:~ joliver$ bash -x ./test.sh
+ case $UID in
+ echo 'Regular user, proceed?'
Regular user, proceed?
+ '[' '' '!=' '[yY]' ']'
+ read -n 1 -s ANS
+ echo y
y
+ case $ANS in
+ echo 'OK, continuing!'
OK, continuing!
+ '[' y '!=' '[yY]' ']'
+ read -n 1 -s ANS

