Which shell are you using ?
try to
double the bracket [[ ]]
initialize your variable
gather the contitions into one bracket [[ || ]] instead of [[ ]] || [[ ]]
remove the double quote inside condition brackets (should be the last thing to try)
... and see if a miracle happen
what about this statement :
printf "$FBOLD\nInvalid number, please enter valid backup number: $FREG"
echo $i
while true
do
read NUM
if [ $NUM -gt 0 -a $NUM -le $i ] 2> /dev/null; then
break
fi
printf "$FBOLD\nInvalid number, please enter valid backup number: $FREG"
done
Also handles any non numeric NUM values: test will fail so break isn't executed, redirect stderr to /dev/null to hide shell error message.