Quote:
Originally Posted by KittyWu
Hi,
I'm not sure this answer suits to your request (if you meant
"how to display/store or use the resulting value", then this
should help...).
First, the 2 first lines sound correct for both defining a variable
and assigning a value to it:
me@host> A="PRE"
me@host> eval ${A}_DAY=`date +%d`
In order to solve this kind of trouble, I usually use this
kind of syntax:
me@host> DAY_VALUE=$(unalias echo; eval echo $"${A}_DAY")
me@host> echo ${DAY_VALUE}
me@host> 25
Hope it helps,
Christophe
|
Ran into a couple of other ways...
echo $(eval echo \$${A}_DAY)
eval echo "\$${A}_DAY"
Thank You for your answer
