Sujet : Re: create variables in a loop?
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : comp.unix.shellDate : 30. May 2024, 01:06:17
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v38cd9$1bce2$2@dont-email.me>
References : 1
User-Agent : Pan/0.158 (Avdiivka; )
On Wed, 29 May 2024 12:57:06 +0200, Dr Eberhard W Lisse wrote:
I would like to do something like
for i in USD GBP do
$i=somevalue
done
does not work, of course.
for i in USD GBP; do
declare -n a=$i
a=somevalue
done
echo $USD $GBP
output:
somevalue somevalue
This is in bash, of course.