Increasing variable#

FreeBSD questions mailing list FreeBSD at amadeus.demon.nl
Wed Oct 13 13:26:14 PDT 2004


Hi
I need some help with this script I'm trying to write.

This is what I have:


#!/bin/sh
Max=4
Count=1

until [ $Count -gt $Max ]
do
        A$Count=" `...something...`"
         Count=$(($Count+1))
done
exit 0


I want to put the result of "something" in a serie of variables with an 
increasing number in it's name:
A1=result_of_something
A2=result_of_something
A3=result_of_something
A4=...
etc.
until $Count > $Max

I don't know how to create such a variables serie, well, at least the 
example isn't working because the syntax A$Count generates an error and 
I have no idea what it should be.
I don't know how to search for such a topic...

Can anyone tell me how this should be handled?

thanks in advance,
Arno



More information about the freebsd-questions mailing list