Unable to set a data to array

Hi All,

Iam trying to set the value to the array... Still its not happening

Following is the code:

#!/usr/bin/ksh

filenames[0]="x";
filenames[1]="y";
echo $filenames[0];
echo $filenames[1];

O/P:

x[0]
x[1]

Iam expecting
x
y

Can some one help me

Echo was supposed to be

echo ${filenames[0]};
echo ${filenames[1]};

Pay attention to placement of { } and [ ] characters

> smile[1]="hi"
> smile[2]="hello"
> echo ${smile[1]}
hi
> echo ${smile[2]}
hello

and also note....

> echo ${smile[*]}
hi hello