home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.shell
- Path: sparky!uunet!haven.umd.edu!darwin.sura.net!mips!sdd.hp.com!caen!destroyer!ubc-cs!news.UVic.CA!csr!stilley
- From: stilley@csr.uucp (Scott Tilley)
- Subject: Re: unwinding $variables in csh
- Message-ID: <1992Aug13.180223.6446@sol.UVic.CA>
- Keywords: resolve, unwind $variables, csh
- Sender: news@sol.UVic.CA
- Nntp-Posting-Host: csr.uvic.ca
- Organization: University of Victoria, Victoria, BC, Canada
- References: <1992Aug9.194325.1476@sol.UVic.CA> <1992Aug12.230438.20870@Cigna.COM>
- Date: Thu, 13 Aug 92 18:02:23 GMT
- Lines: 12
-
-
- Well, using eval will work, but only for one layer of unwinding, if you
- will. The solution I came up with is:
-
- while ( $var =~ *\$* )
- set var = `eval echo $var`
- end
-
- This just keeps looping as long as it finds a '$' in the current "val",
- and if so, eval's it. Messy, but works for me.
-
- ..Scott
-