if [[ $GreaterThanTwenty==1 && $LessThanThirty==1 ]]
then
echo "within limits"
else
echo "Outside limits"
fi
echo $GreaterThanTwenty
echo $LessThanThirty
Why is Within limits triggered even though the echoes show that at this point LessThanThirty is actually 0?
You should compare arithmetic values using one of these: -eq, -ne, -lt, -le, -gt or -ge, meaning equal, not equal, less than, less than or equal, greater than and greater than or equal, respectively.
Reference: http://www.ibm.com/developerworks/library/l-bash-test/index.html