Skip to content

Instantly share code, notes, and snippets.

@joycse06
Forked from 9re/clean_mac_files_from_zip.sh
Created April 21, 2014 07:21
Show Gist options
  • Save joycse06/11134909 to your computer and use it in GitHub Desktop.
Save joycse06/11134909 to your computer and use it in GitHub Desktop.
#!/bin/bash
# remove __MACOSX foldr and .DS_Store files
# from *_original.zip file
# zip again and place under fixed/*
for x in $*
do
unzip $x
done
# remove mac foler
find . -name "__MACOSX" -exec rm -rv {} \;
# remove .DS_Store files
find . -name ".DS_Store" -exec rm -v {} \;
mkdir -p fixed/
for x in $*
do
y=`echo ${x%%_original.zip}`
zip -r $y.zip $y
mv $y.zip fixed
rm -rv $y
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment