Created
January 31, 2017 00:48
-
-
Save brhoades/b3e1a3ff1f3d0ef12b1cf176037e382d 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
rm -rf repacked unpacked | |
mkdir repacked &> /dev/null | |
mkdir -p unpacked &> /dev/null | |
for f in $(ls *.gz) | |
do | |
newfn=$(echo $f | perl -ne "print /(.+).tar.gz/") | |
#newdir=$(pwd)/unpacked/$newfn | |
#mkdir -p $newdir &> /dev/null | |
tar xvf $f -C unpacked | |
mv unpacked/${newfn}_submit unpacked/$newfn | |
done | |
for f in $(ls unpacked) | |
do | |
if [ -d "unpacked/$f" ]; then | |
tar cvf "$(pwd)/repacked/$f.tar.gz" -C "unpacked" "$f" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment