Reputation: 23
I need to echo the value of $bootlog1 through $bootlog5.
Something like this:
for n in (seq 5)
set bootlog$n value
echo $bootlog$n
end
But I can't seem to figure it out.
Upvotes: 2
Views: 60
Reputation: 247092
Easier to use an intermediary variable:
for n in (seq 5)
set var bootlog$n
set $var (random)
echo $var = $$var
end
bootlog1 = 20819
bootlog2 = 19479
bootlog3 = 11254
bootlog4 = 23223
bootlog5 = 23674
Upvotes: 4