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

[no subject]



I think the easiest way to do this in ksh is:

${XYZ:-$ABC}

If XYZ is not set, then the value of ABC is evaluated and returned.  As 
long as XYZ is never set to anything, this construct will always 
re-evaluate ABC and return that value.

This may or may not work for you depending ont the context in which 
you'll use it.

I don't know if that works in bash, to tired to try... :)

-- 
Until later, Geoffrey                     Registered Linux User #108567
Building secure systems in spite of Microsoft


</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="00726" href="msg00726.html">[ale] variable variables in bash/ksh?</a></strong>
<ul><li><em>From:</em> jb at devsea.com (John Wells)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00740.html">[ale] Linux Cluster Server Room</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00742.html">[ale] variable variables in bash/ksh?</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00751.html">[ale] variable variables in bash/ksh?</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00739.html">[ale] GPRS pc-card experience?</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00741"><strong>Date</strong></a></li>
<li><a href="threads.html#00741"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>

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