Hi folks,
here's another task I'm facing:
I'm using a dynamic array (e.G. set -A arrayA ...) to read the names of certain databases out of a command output.
Now what I'd like to do is create several new arrays for every entry in arrayA but the new arrays are supposed to have the entry as part of their names.
e.g.:
arrayA contains the following entries:
And the new arrays are supposed to be named like this:
Here's what I tried so far:
But somehow it's not working.
Any ideas ?
Regards,
Thomas
here's another task I'm facing:
I'm using a dynamic array (e.G. set -A arrayA ...) to read the names of certain databases out of a command output.
Now what I'd like to do is create several new arrays for every entry in arrayA but the new arrays are supposed to have the entry as part of their names.
e.g.:
arrayA contains the following entries:
Code:
CARS
BIKES
MOTORCYCLES
STROLLERS
And the new arrays are supposed to be named like this:
Code:
Content_CARS
Content_BIKES
Content_MOTORCYCLES
Content_STROLLERS
Here's what I tried so far:
Code:
i=0
while [ $i -le 5 ];
do
set -A Content_${arrayA[$i]} $(cat ${arrayA[$i]}.txt)
i=`expr $i + 1`
done
But somehow it's not working.
Any ideas ?
Regards,
Thomas