i get zip files or tar files to work upon.
The zip /tar file may have a several directories and sub-directories which in-turn may contain tar files / zip files
I need to untar / unzip those which are present inside the parent Tar / Zip at their respective directory locations and then delete the tar / zip file.
Below is what i could achieve but the problem is it untars / unzips only the parent tar/zip and not the those which are present inside the zip / tar.
found=1 while [ $found -eq 1 ] do found=0 for compressfile in *.tar *.zip do found=1 echo "EXTRACT THIS:"$compressfile tar xvf "$compressfile" && rm -rf "$compressfile" unzip "$compressfile" && rm -rf "$compressfile" exc=$? if [ $exc -ne 0 ] then exit $exc fi done done
Note: the Tar file may contain both Tar and Zip files. Likewise The Zip may contain Zip or Tar files.