I\'m trying to write a comparison in a while statement that\'s case insensitive. Basically, I\'m simply trying to shorten the following to act on a yes or no question promp
No need to use shopt or regex. The easiest and quickest way to do this (as long as you have Bash 4):
if [ "${var1,,}" = "${var2,,}" ]; then echo "matched" fi
All you're doing there is converting both strings to lowercase and comparing the results.