Created
August 23, 2012 10:10
-
-
Save icaoberg/3435104 to your computer and use it in GitHub Desktop.
Zip all the subfolders of the folders in the current path
This file contains 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 | |
for FOLDER in *; | |
do | |
if [ -d "$FOLDER" ]; | |
then | |
echo $FOLDER | |
for SUBFOLDER in "$FOLDER"/* | |
do | |
if [ -d "$SUBFOLDER" ] | |
then | |
zip -r "$SUBFOLDER".zip "$SUBFOLDER" | |
fi | |
done | |
fi | |
clear | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment