Skip to content

Instantly share code, notes, and snippets.

@ronaldsuwandi
Last active September 30, 2020 06:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ronaldsuwandi/867fcc957f06c266aa4d126d9877c001 to your computer and use it in GitHub Desktop.
Save ronaldsuwandi/867fcc957f06c266aa4d126d9877c001 to your computer and use it in GitHub Desktop.
Create .cbz file from directory
#!/bin/bash
if [ -z "${prefix}" ]; then
echo "warn: prefix is not set"
fi
for f in *; do
if [ -d "${f}" ]; then
echo "Zipping ${f} to ${prefix}${f}.cbz"
zip -r "${prefix}${f}.cbz" "${f}"
fi
done
if [ "${delete}" ]; then
echo "deleting directories..."
for d in */; do
echo $d
rm -rf "$d"
done
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment