How do you search for strings within a zip archive?
I’m tinkering with EPUB3 files, and I wanted to be able to find certain strings within .epub files, so I had a look around, and I immediately found zgrep and family. The trouble was that zgrep assumes a single zipped file, not an archive.
So, without further ado, I wrote the following script, which I called, naturally, zipgrep. It uses grep and unzip, which it assumes to be available on the PATH. Not wanting to have to pick through the argument list, I decided to mark the end of arguments to grep with the traditional ‘—‘, after which I could stack up as many zip file names as I liked.
