echo " Enter the Variable to be tested"
read Test_Var
if [[ "$Test_Var" -gt 999 && "$Test_Var" -lt 10000 ]]
then
echo "It is a Year";
else
echo "Is is not a Year";
fi
case $Test_Var in
[1000-9999] ) echo "It is a Year";;
* ) echo "Is is not a Year";;
esac
will match a single character that is 1, 0, 0, any single digit in the range 0 through 9, 9, 9, or 9. So if Test_var had been set to "6", it would say it is a year. Bracket expressions don't look for ranges of numeric values.
Hope this helps you understand what was going wrong.