Maybe I'm having a bad day, or maybe this is another reason for why I hate writing bash.
Code:
#!/bin/bash
xvloop='x'
xchoice=''
XSTATUS="N/A"
while [ "$xvloop" = 'x' ]; do
clear
printf "\n\n
Some Status: ${XSTATUS}
Some Sub Menu
A: Some Function
B: Go Back
Choice: "
read choice
case $xchoice in
[Aa]) echo "Hello World"; XSTATUS="Changed"; clear;;
[Bb]) xvloop='Z'; xchoice=""; clear; break;;
esac
# DEBUG MESSAGE
echo "${xvloop} - ${xchoice}"
done
# DEBUG MESSAGE
echo "PAST DONE"
I am stuck in the while loop. When I print out the xvloop variable, it's still set to x... While xchoice is "" (blank).
EDIT: D'OH! I am reading a null variable.