title: Loop through and unzip directories and then unzip items in subdirectories
body: <p>I have a folder designed in the following way:</p>
  
  <pre><code>-parentDirectory
  ---folder1.zip
  ----item1
  -----item1.zip
  -----item2.zip
  -----item3.zip
  ---folder2.zip
  ----item1
  -----item1.zip
  -----item2.zip
  -----item3.zip
  ---folder3.zip
  ----item1
  -----item1.zip
  -----item2.zip
  -----item3.zip
  </code></pre>
  
  <p>I would like to write a bash script that will loop through and <code>unzip</code> the folders and then go into each subdirectory of those folders and unzip the files and name those files a certain way.</p>
  
  <p>I have tried the following</p>
  
  <pre><code>cd parentDirectory
  find ./ -name \*.zip -exec unzip {} \;
  
  count=1
  
  for fname in *
  do
      unzip
      mv $fname $attempt{count}.cpp
      count=$(($count + 1))
  done
  </code></pre>
  
  <p>I thought the first two lines would go into the parentDirectory folder and unzip all zips in that folder and then the for loop would handle the unzipping and renaming. But instead, it unzipped everything it could and placed it in the parentDirectory. I would like to maintain the same directory structure I have.</p>
  
  <p>Any help would be appreciated</p>