You are not logged in.
I have a variable with a variable name in it. I think I once saw an easy way to get the value of the second variable, but all that seems to work for me is with eval:
$ var=foo
$ foo=bar
$ eval echo \$$var
bar
How can this be done without eval?
Offline
that's what's used in /etc/rc.d/network
Offline
echo ${!var}
This is called indirection. See http://wooledge.org:8000/BashFAQ/006
< Daenyth> and he works prolifically
4 8 15 16 23 42
Offline
Thanks, works great.
Offline
echo ${!var}
This is called indirection. See http://wooledge.org:8000/BashFAQ/006
Cool. Bash knowledge++.
Offline
awesome
Offline