I am downloading a zip file which has a very deep nested structure from which I just need to pick a few files. The file structure looks like this:
myfile.zip/
C*_01.zip, ....., C*_xx.zip/
In each C*_xx.zip file:
a*.zip
b*.zip
..../
file1.txt
file2.txt
...
targetfile.txt
...
Please note that on each "C*.zip" I need to pick the target file.
I do not have much experience with shell scripting so I have written a script based on other solutions but it doesn't work. I would appreciate any hint:
wget url | find . -name "myfile.zip" | while ["`find -type f -name 'C*.zip' | wc -l`" -gt 0 ]; do find -type f -name "b.zip" | find -type f -name "targetfile.txt" exec unzip -- '{}' \;; done