I have created an array in dtksh for doing the following:
catArray[0]=/home/bmis/Servers
catArray[1]=/home/bmis/Desktops
catArray[2]=/home/bmis/Storage
catArray[3]=/home/bmis/Networking
do
cd ${catArray[$i]}
for dirs in *; do
if [[ -d "$dirs" ]]; then
dirArray="$dirArray ${catArray[$i]}/$dirs"
fi
done
done
Using this array, I would like to do:
do
cd ${catDirArray[$i]}
for dirs in *; do
cd $dirs/$QUERY_STRING
for files in *; do
if [[ -e "$files" ]]; then
--------> "${catDirArray[$i]##*/}Array"="${catDirArray[$i]##*/}Array $files"
fi
done
cd ${catDirArray[$i]}
done
done
----> Points to the problem I'm encountering. I would like to
create a new array depending on where I'm at within my for loop.
So, I would like to have X # of new arrays created dependent on my
conditional "if [[ .. ]]"
Any idea how to accomplish this? I've tried for 2 days and can't
resolve it.
Thanks in advance,
Patrick