To Check whether the Input is a Year or Not?

view full story

http://www.unix.com – Hi Guys I have a Requirement that the input will be given and i have to check whether the input is a Year or not. For Example 2004,2009 and so on forth will be considered a year and anything else like 12:15 or else will not be. Have built the below Code Code: set -x echo " Enter the Variable to be tested" read Test_Var case $Test_Var in [1000-9999] )  echo "It is a Year";;  * )          echo "Is is not a Year";; esac But everything is going to the "Not Year" Part. I am little bit new to Shell Scripting. (HowTos)