Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!samsung!uunet!convex!convex.COM From: tchrist@convex.COM (Tom Christiansen) Newsgroups: comp.unix.questions Subject: Re: recursive variable substitution in csh Message-ID: <105019@convex.convex.com> Date: 16 Aug 90 18:38:24 GMT References: <9045@cg-atla.agfa.com> Sender: news@convex.com Reply-To: tchrist@convex.COM (Tom Christiansen) Distribution: usa Organization: CONVEX Software Development, Richardson, TX Lines: 19 In article <9045@cg-atla.agfa.com> jmacdon@cg-atla.UUCP (Jeff MacDonald) writes: >In the C-shell, how does one evaluate a variable which contains the >name of a variable in order to get the value of the variable >contained by the variable that one is evaluating? > >set x = 'ABC' >set y = '$x' >set z = # some function of y such that $z == "ABC" % eval set z = "$y" % echo $z % ABC --tom -- Tom Christiansen {uunet,uiucdcs,sun}!convex!tchrist Convex Computer Corporation tchrist@convex.COM "UNIX was never designed to keep people from doing stupid things, because that policy would also keep them from doing clever things." [gwyn]