problem in access in array variables

hi all, its me again!!! i've requirement like this:
i want to create a file & an array with its name having the filename as its substring. here is the test script!!

#!/bin/bash
touch $1
declare -a $1_rec;
echo -n "$1_rec[1]: "
read $1_rec[1];
echo $[$1_rec[1]];

now see output:
this is when i enter only numeric value:

$./ex3 hell
hell_rec[1]: 45
45

when entered string or char.:

$ ./ex3 hell
hell_rec[1]: boy
0

entered alphanumeric string with number first:

$ ./ex3 hell
hell_rec[1]: 45ex
./ex3: line 6: 45ex: value too great for base (error token is "45ex")

entered alphanumeric string with char. first:

$ ./ex3 hell
hell_rec[1]: ex45
0

i actually wanted the value entered to redirect into the file.

thanks in advance!
regards
prayush

echo $[$1_rec[1]];

should be

echo ${$1_rec[1]};

thanks binlib, but its not working!!:confused:
the code:

echo ${$1_rec[1]};

is giving this error:

./ex2: line 11: ${$1_rec[1]}: bad substitution

please help me ..its urgent!!!

How about ...

echo ${1_rec[1]};

thanks dr.house!! but again output is same!!

./ex2: line 16: ${1_rec[1]}: bad substitution

i've tried all possible combination..but helpless!!!!!!!:frowning:

#!/bin/bash
touch $1
declare -a ${1}_rec;
echo -n "${1}_rec[1]: "
read ${1}_rec[1];
eval echo \${${1}_rec[1]};

try

declare -a ${1}_rec
echo -n "${1}_rec[1] : "
read ${1}_rec[1]
echo $(eval echo \${${1}_rec[1]})

seems to work
P.S. sorry I didn't see that vgersh has already posted a reply

thanks a ton vgersh & sidorenko,
u solved my problem.:b:

regards
prayush