On 6/10/13 5:43 AM, Linda Walsh wrote:
> What I found myself wanting was having several 'sets' of
> the same parameters of info. so I could have
> multiple hashes or associative arrays,
>
> eth0=([ip]=1.2.3.4/24 [mtu]=1500 [startmode]=auto)
> eth1=([ip]=192.168.0.1/24 [mtu]=9000 [startmode]=onboot)
>
> Then wanted to be able to pass which interface to work on, into
> a function i.e. pass in 'eth0' or 'eth1'... etc.
>
> In the function, the parameter would be in a var maybe "IF".
>
> Now I want to access the value for IP for the current "IF" (IF holding
> eth0 or eth1 or some other InterFace name).
This is an excellent statement of the rationale for nameref variables,
which will be implemented in bash-4.3.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU [email protected] http://cnswww.cns.cwru.edu/~chet/