using variable in a variable

Hi,

I Have two variables declared like this:
ID="EAR"
PART_EAR="GEFEAR"

and I want to get in the same script the value of the variable PART_$ID which should be "GEFEAR".
I try with eval function but it seems not working.

Does someone knows something about this ?

Thanks for your help.

Hi,
Im not following ...
Could you please try and explain more?

thanks

/peter

Sorry,

I've found the solution of my pb using eval function like this:
ID="EAR"
PART_EAR="GEFEAR"
=> eval echo \$PART_$ID
should equal to "GEFEAR".

Thanks.

hi all

Iam trying to use eval function in unix scripting
#!/bin/ksh
function evalval {

rate=$(( $1 * $2 ) * (1 -( 100 * $3)))
eval [$rate]
}
evalval $*
echo $rate

evalval: syntax error: `*' unexpected

i am getting the above error
can any one correct this?

function evalval {
    rate=$(( ($1 * $2) * (1 - ( 100 * $3)) ))
}

evalval $*

echo $rate