Search files from sub folders

A folder contains 30-50 subfolders generated on a daily basis, each subfolder contains more than 10-20 files of .html.gz files format. we have to manually convert the .html.gz file to .html format on a daily basis available in all the sub folders.

the procedure we are following is

copying all the .gz files into the temp folders
mkdir temp
cp *.* temp
gunzip *.gz

moving the .html to the sub folder

for i in `ls -1`
do
mv $i $i.html
done

goto created temp folder
move all those *.gz files to previous directory and then check for that subfolder is having .html files and *.gz file
Repeat the same for all subfolders in a directory and check for next main directory.

As this is taking more time to do for all the subfolders.

Can some please write a script to do this activity . Please do the needful

(insert I don't like terms like "write a script" or "do the needful" here)

If the question you're asking is "how do I 'convert' a lot of .html.gz files into .gz files?" then, using gunzip:

cd /directory_with_all_my_html_gz_files
find . -name *.gz | xargs gunzip

The script examples posted do not match the anotation posted. As "scottn" implies, please post what you are trying to do (with examples) ?

Hi Scottn,

The script posted by you does not match , please post the correct script