Sujet : Re: create variables in a loop?
De : lew.pitcher (at) *nospam* digitalfreehold.ca (Lew Pitcher)
Groupes : comp.unix.shellDate : 29. May 2024, 13:10:32
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v375vo$14a46$1@dont-email.me>
References : 1
User-Agent : Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2)
On Wed, 29 May 2024 12:57:06 +0200, Dr Eberhard W Lisse wrote:
Hi,
I would like to do something like
for i in USD GBP
do
$i=somevalue
done
does not work, of course.
Any idea on how to create (and fill variables through a loop)?
echo $CAD $EUR
for i in CAD EUR
do
eval "$i=someval"
done
echo $CAD $EUR
The /eval/ operation is one of those "special built-in utilities
that POSIX mandates all POSIX shells must support
greetings, el
-- Lew Pitcher"In Skills We Trust"