All that work! <sigh>
One more time on the Z-Shell bandwagon...

#!/bin/zsh

mkdir /tmp/newstuff
cd /tmp/oldstuff

for a in **/*.zip                       ### recursive find of all zip files
do
    mkdir -p "/tmp/newstuff/$a:h"        ### build other dir structure
    unzip -d "/tmp/newstuff/$a:h" "$a"   ### unzip file into new dir
done


:h modifies any variable by removing the trailing pathname leaving the head.
Quotes preserve the spaces (or other funky characters).

Do the same thing with your tar and rar files.
Seems easier to me, but to each their own.
Gerry



--
gsker at comcast.net
gerry