[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]



I'm trying to figure out a way to use, to borrow from PHP, variable variables in shell.

For example, consider the following:

XYZ="ABC"
ABC=123456

# in php, I can do the following and get "123456" as the result, so it
# first evals XYZ to get ABC, and then applies the second $ to ABC to
# get the value of $ABC
echo $$XYZ

Anyone know how to do this in bash or ksh?  Seems like something I once knew, but it escapes me now...

Thanks,
John


</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<ul><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><a name="00730" href="msg00730.html">[ale] variable variables in bash/ksh?</a></strong>
<ul><li><em>From:</em> phasefx at magusaptus.com (Jason Etheridge)</li></ul></li>
<li><strong><a name="00741" href="msg00741.html">[ale] variable variables in bash/ksh?</a></strong>
<ul><li><em>From:</em> esoteric at 3times25.net (Geoffrey)</li></ul></li>
</ul></li></ul>
<!--X-Follow-Ups-End-->
<!--X-References-->
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00725.html">[ale] Woof</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00727.html">[ale] Woof</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00724.html">[ale] Merging IMAP directories</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00730.html">[ale] variable variables in bash/ksh?</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00726"><strong>Date</strong></a></li>
<li><a href="threads.html#00726"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>