To verify whether the year has all the digits

I have a code unit based on which i have this code snippet

year='2009'
echo year is $year
if [[ $year != @([0-9])@([0-9])@([0-9])@([0-9]) ]]
then
echo 'year in error'
fi
echo end of program

Here i want to find whether all the characters in the variable year are numbers. I am not sure whether this works or not because when i make a small shell out of the above snippet i get the following error

year is 2009
t1.sh: syntax error at line 3: `(' unexpected

Please let me know what is wrong :o

PS: I am not very good at Unix

You can do this way also...

if [[ ! -z `echo $year | tr -d '[0-9]'` ]]
then
   echo "Error"
fi

^^
This is what i did

year='2009'
echo year is $year
if [[ ! -z `echo $year | tr -d '[0-9]'` ]]
then
echo 'year in error'
fi
echo end of program

But i got this error

t1.sh: [[: not found

Which shell you are using ?..

Try with single "[" instead of two.

^ Thanks a million Buddy...its working

Just one more question, if i repace the original IF condition with this revised one then still the meaning of the whole thing remains same right ?

---------- Post updated at 02:42 AM ---------- Previous update was at 02:26 AM ----------

Guys the earlier problem is rectified but a new one has come now

Here s the offending code

if [[ $myline = [a-zA-Z0-9]*_ACCRUAL_@([0-9])@([0-9])@([0-9])@([0-9])@([0-9])@([0-9])@([0-9])@([0-9]).csv ]]

Here the variable myline contains some file name and i suppose that is being checked for format and all. :0

---------- Post updated at 04:23 AM ---------- Previous update was at 02:42 AM ----------

The above code unit is giving me following errors

syntax error in conditional expression: unexpected token `('
syntax error near `[a-zA-Z0-9]*_ACCRUAL_@(['
# echo $year | awk '{print ($0+0==$0)?"ok":"not ok"}'
ok