View Single Post
Old 02-25-2013, 07:40 AM   #24
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by roger64 View Post
I then tried the customary:
Code:
roger@lmde64:~/Bureau/Test$ zip *.epub META-INF/com.apple.ibooks.display-options.xml
updating: META-INF/com.apple.ibooks.display-options.xml (deflated 27%)
  adding: Cocardes et dentelles v2.epub (deflated 1%)
roger@lmde64:~/Bureau/Test$
Result: Only the first EPUB file was correctly processed. The second one, "Cocardes et dentelles v2" was not.
Not only that, but the whole second EPUB was added to the first, that's the way the zip command works. What you did is equivalent to:

Code:
zip file1.epub file2.epub apple.xml
which adds file2.epub and apple.xml to file1.epub.

For what you want, you could use bash loops, which may look daunting, but it's really simple:

Code:
for i in file1.epub file2.epub
do zip "$i" apple.xml
done
(the first line is just "repeat the block, each time assigning to the variable 'i' one of the values listed"). The linebreaks are important, but you can replace them with semicolons:

Code:
for i in file1.epub file2.epub; do zip "$i" apple.xml; done
(putting $i between quotes ensures that it works properly if the filename includes spaces, in which case, of course, you should write them between quotes in the first line as well).
Jellby is offline   Reply With Quote