Skip to content

Instantly share code, notes, and snippets.

@jasoet
Last active December 22, 2015 14:18
Show Gist options
  • Save jasoet/6484444 to your computer and use it in GitHub Desktop.
Save jasoet/6484444 to your computer and use it in GitHub Desktop.
Zip and Rename
#!/bin/bash
IFS=$'\n'
for f in $(find $1 -type d ); do
echo $f
zip -r $f $f
#mv -f $f `echo $f | sed s/zip/cbz/`
done
for f in $(find $1 -mindepth 1 -maxdepth 1 -type f -name "*.zip" ); do
echo $f
#zip -r $f $f
mv -f $f `echo $f | sed s/zip/cbz/`
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment