bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: currently doable? Indirect notation used w/a hash


From: Chet Ramey
Subject: Re: currently doable? Indirect notation used w/a hash
Date: Mon, 10 Jun 2013 09:37:15 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130328 Thunderbird/17.0.5

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    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]