View Single Post
Old 09-29-2017, 05:12 PM   #5
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Hi

This is a first working result made by a friend of mine which could be improved. Up to now, it processes only EPUB where the CSS file is in : OPS/style.css. It has to be adapted on this regard.

Spoiler:

Code:
#!/bin/bash
for fichier in *.epub
do
    unzip $fichier OPS/style.css
    if [ -d ./OPS ]; then
        cd OPS
        find . -type f -iname "style.css" -exec sed -i -e "s/vertical-align:top/vertical-align:text-top/g" {} \;
        cd ..
        zip -r $fichier ./OPS
        rm -rf ./OPS
    fi
done
roger64 is offline   Reply With Quote