I cannot seem to pass the value of the variable assigned in the "else" statment below to an "if" statement outside of the loop. When I debug using "set -x", I find that the value of "$A" is empty. Is there something I'm missing here? Code is below:
do
if [[ "$var1" = "L" && "$var2" = "e" ]] then
echo "Good Match" $var1
elif [[ "$var1" = "T" && "$var2" = "t" ]] then
echo "Good Match" $var1
elif [[ "$var1" = "P" && "$var2" = "c" ]] then
echo "Good Match" $var1
else
echo "No Match"
A = "N"
fi
done
if [[ $A = "N" ]] then
exit
TIA.