Created
October 30, 2016 12:31
-
-
Save ialert/11c2856c5655f7c75653210f422b067f to your computer and use it in GitHub Desktop.
Сreate 7z archive for all directories in current folder
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 | |
SAVEIFS=$IFS | |
IFS=$(echo -en "\n\b") | |
command="ls -l | grep "^d"" | |
for i in $(ls -d */); | |
do | |
dir=$PWD/${i%%/} | |
cd "$dir" && 7z a -mx5 "../${i%%/}.7z" | |
cd .. | |
done | |
IFS=$SAVEIFS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment