jo_aze
1
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.
s93366
2
Hi,
Im not following ...
Could you please try and explain more?
thanks
/peter
jo_aze
3
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