Created
September 16, 2019 13:55
-
-
Save pavgup/dd3679cb1037fbf436aeb756ecc9c71a to your computer and use it in GitHub Desktop.
Fusion Export Nested Unzipper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Nested Unzipping, Updated for MacOS Find Utility | |
# Pavan Gupta - September 16, 2019 | |
# Drop this script into a directory with your zip file, execute, wait for nested directories | |
# TODO: Zips with zip files in them having the same name would | |
# cause unzip to drop files into the same directory causing collisions potentially | |
function extract(){ | |
unzip $1 -d ${1/.zip/} && eval $2 && cd ${1/.zip/} | |
for zip in `find . -maxdepth 1 -iname '*.zip'`; do | |
echo $zip | |
extract $zip 'rm $1' | |
done | |
cd .. | |
} | |
extract 'somefile.zip' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment