On 06/06/2014 09:30 PM, ToddAndMargo wrote:
On 06/06/2014 09:23 PM, ToddAndMargo wrote:
On Fri, Jun 6, 2014 at 8:52 PM, ToddAndMargo <toddandma...@zoho.com
<mailto:toddandma...@zoho.com>> wrote:
Hi All,
In Bash script language, how do I create a variable name
from a variable?
I am trying to create a variable called "abcStatus"
x=abc
$xStatus=xyz
obviously doesn't work. What am I doing wrong?
Many thanks,
-T
On 06/06/2014 09:09 PM, Patrick J. LoPresti wrote:
x=abc
eval ${x}Status=xyz
echo $abcStatus
- Pat
Hi Pat,
Wow. I would have never figured that out on my own.
Thank you!
Follow on question: this works, but I would like
to clean it up:
xx=ech
eval "$xx""o abc"
abc
-T
How do I echo the variable?
echo $(eval "${x}Status")
isn't working
eval echo \$${x}Status
xyz
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Computers are like air conditioners.
They malfunction when you open windows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~