Csh question

David Ellis ellis at ultra.dec.com
Wed Jul 20 02:08:00 AEST 1988


In the csh, the expression $name or ${name} looks up the variable with the
given name and substitutes its value.

Is there any way to get the value of a variable whose name is the value of
another variable?

e.g. if we've done set x=a and set a=3, is there any simple csh expression
in terms of x that yields the value of a (3)?

Csh gives an error message "Variable syntax." if I try something like
	echo ${$x}
or even
	echo "`echo {\$}$x`"

----
David Ellis
Digital Equipment Corporation -- BXB1-1/D03 
85 Swanson Road, Boxboro MA 01719 -- (617) 264-5073
Usenet:  {ucbvax,allegra,decvax}!decwrl!ultra.dec.com!ellis
ARPA:    ellis%ultra.dec at decwrl.dec.com



More information about the Comp.unix.questions mailing list