hi catkin!
An unbound variable is one that has not been defined.
So lets review something...
Code:
[~]$ a=b
[~]$ echo $a
b
[~]$ echo ${a}
b
[~]$ echo $[a]
0
The only time i have seen
[] in variables is in arrays like a[0] so maybe $[] is referencing a non existent array and is giving you the value 0.
If you are trying to reference to the "d" through "a" then i guess this would do the trick:
Code:
a=letter # Variable "a" holds the name of another variable.
letter=z
echo
# Direct reference.
echo "a = $a" # a = letter
# Indirect reference.
eval a=\$$a
# ^^^ Forcing an eval(uation), and ...
# ^ Escaping the first $ ...
# ------------------------------------------------------------------------
# The 'eval' forces an update of $a, sets it to the updated value of \$$a.
# So, we see why 'eval' so often shows up in indirect reference notation.
# ------------------------------------------------------------------------
echo "Now a = $a" # Now a = z
Now, remember that i am not an expert and this is just what i can see from the outside.
Im still learning.