Created
January 22, 2017 18:03
-
-
Save David-Estevez/b06c3c2bd115508954aa62f517a61821 to your computer and use it in GitHub Desktop.
Rename Ebook acording to the PDF's title and author metadata
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
TITLE=`pdfinfo $1 | head -n 2 | cut -d ':' -f2 | head -n1 | sed -e 's/^[[:space:]]*//'` | |
AUTHOR=`pdfinfo $1 | head -n 2 | cut -d ':' -f2 | tail -n1 | sed -e 's/^[[:space:]]*//'` | |
echo "$TITLE - [$AUTHOR]" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment