how do I store the values in array using shell

Hi,

Is is possible to get the value using shell script?

x=1
y1 = 10
y2 = 15
y3 = 7

echo $y$x is giving y1 \(variable name\)
but I need the value of y1 \(i.e. 10 dynamically\)

Is there any solution?

if so, please mail me at kkodava@maxis.com.my

Thanx

set -A VARNAME 1 10 15 <- init array

echo ${VARNAME[0]} giving 1
echo ${VARNAME[2]} giving 15

to initialize the array you can also do thing like this(in ksh scripts)

set -A VARNAME $(ls)

try it

Thanks michael,

I will try.

krishna