Skip to content

Instantly share code, notes, and snippets.

@rvbhute
Created April 4, 2013 07:26
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 rvbhute/5308505 to your computer and use it in GitHub Desktop.
Save rvbhute/5308505 to your computer and use it in GitHub Desktop.
Two versions for creating CBZ (Comic Book archive) files out of a directory of images. These files can be opened in comic readers. In Linux, applications like Evince also handle CBZ files with ease.
#!/bin/sh
# First version, to use only a particular file-type in a folder
for f in `ls -l | egrep '^d' | awk '{print $NF}'`
do
cd $f
zip $f.cbz *.jpg
mv $f.cbz ../$f.cbz
cd ..
done
# Second version, useful if images are multiple file formats
# Be careful to clear out non-image files first!
for f in `ls -l | egrep '^d' | awk '{print $NF}'`
do
zip $f.cbz $f/*.*
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment