Hi,
here is the problem description...
X=1
var${x}=abc
echo ${var${x}}
It is not working...
Is there any solution..
Thanks,
Swat
Hi,
here is the problem description...
X=1
var${x}=abc
echo ${var${x}}
It is not working...
Is there any solution..
Thanks,
Swat
x=1
var="abc$(printf ${x})"
echo $var
abc1

Swat - uppercase X and lowercase x are not the same variable.
Using bash
$ X=1
$ eval var${X}=abc
$ echo $var1
abc
$ ref="var"${X}
$ echo $ref
var1
$ echo ${!ref}
abc
Using ksh93
$ X=1
$ eval var${X}=abc
$ echo $var1
abc
$ nameref ref="var"${X}
$ echo $ref
abc
$