Results 1 to 4 of 4
i want to access the variable name's variable value as
a=testing
b=a
how to print by only using variable b.
echo ${$b} --> it should print testing, how to do ...
- 11-08-2008 #1
accessing variable name's variable value
i want to access the variable name's variable value as
a=testing
b=a
how to print by only using variable b.
echo ${$b} --> it should print testing, how to do that..
( i know this echo will say error )
by the above example, if you are not able to understand.
I have the b variable has value "a", which is the variable name "a",
i need to access that variable, by knowing only the second variable name ????
- 11-08-2008 #2Use printf if your shell does not have the print builtin.Code:
% a=testing % b=a % eval print \$$b testing
- 11-08-2008 #3Just Joined!
- Join Date
- Nov 2008
- Location
- China
- Posts
- 4
if using BASH, it can be
Code:a=testing b=a eval echo $$b
- 11-08-2008 #4


Reply With Quote
