Created
September 29, 2022 10:34
-
-
Save shoarai/2d1c1a3dd900839780674d5027746ccb to your computer and use it in GitHub Desktop.
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 | |
# d2zip zips each of all folders directly under | |
# the d folder in the same folder as the d2zip.sh. | |
# e.g.) | |
# . | |
# ├── d2zip.sh | |
# └── d/ | |
# ├── folderA/ -> ziped to folderA.zip | |
# └── folderB/ -> ziped to folderB.zip | |
ROOT=d | |
set -eu | |
cd "$(dirname "$0")" | |
cd ./$ROOT | |
IFS=$'\n' | |
for f in *; do | |
zip -r $f.zip $f | |
done | |
echo "Succeed!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment