Search code examples
bashzipjpeg

convert jpg to cbz in sorted order?


This converts all the jpgs to cbz file but the images not in the order.

zip comic.cbz $(ls -v *.jpg)

The jpg files are named as comic-0.jpg, comic-1.jpg, etc.

Any fixes?


Solution

  • Filename expansion expands files in order:

    zip comic.cbz *.jpg