Last active
July 4, 2020 20:33
-
-
Save framiere/97f2c8aee828b60b2eae1186ac9ee70b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for epub in $(ls *epub| grep -vE "\(\d+\)\.epub$") ; do | |
content=$(unzip -p $epub OEBPS/content.opf) | |
title=$(echo $content | xpath "(//dc:title/text())[1]") | |
identifier=$(echo $content | xpath "(//dc:identifier/text())[1]") | |
mv $epub "$title ($identifier).epub" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment