Problem with array and creating directories

I have an interesting requirement. I have declaried an array like :-

arr=`find . ! -name "." | xargs -I {} echo {} | cut -c 2-${#}`

Then i will try to access the array elements like :-

i=0
for i in ${arr}; do

Here comes the confusions, the array elements are basically dir and files stored as strings
something like :-
"/etc/src/esr/11.2/aix" - This is a dir
"/etc/src/esr/11.2/aix/defalut.cfg" - This is a file inside the above dir

"/etc/src/esr/11.2/fn" - This is a dir
"/etc/src/esr/11.2/hpux/fn95anes.cfg" - This is a file inside the above dir

I want to create the same directories and files(with contents in the file) in destination as well.
That means i need to check whether the array element is dir/file then accordingly i need to create directories inside that i need to create files respectively

I did something like

if [[ -d $DIR/$i ]] ; then  (DIR and DEST are predefined location)
mkdir $DIR/$i $DEST/$i
elif [[ -f $DIR/$i ]] ; then
cp $DIR/$i $DEST/$i

But it is not properly creating files inside directories, please help me out

Thanks in advance
Renjesh

I think if [[ -d $DIR/$i ]] should be if [[ -d $i ]]
You are having absolute paths in array element.

Or, do you mean to say you are having structure like this..

/a/b/c/etc/src/esr/11.2/aix
# where /a/b/c is the value of $DIR

In any case,Why do you need to do mkdir $DIR ?
have a look at mkdir -p

I guess you need to backup your "files" in another location with the same directory structure.
If yes, get ONLY file list (not dirs) in array or in a file and try something like..

for i in ....
do
 dest=/path/prefix/${i%/*}
 mkdir -p $dest || echo "unable to create dir $dest"
 cp $i $dest
done

DIR :- location form there i want to take backup(both files and directory needed)

DEST :- Location where i need the backed files

What ever is there in Array, i need to copy whether it is a file or directory. If it is a files, i need the content also .

Thanks
Renjesh Raju