Skip to content

Instantly share code, notes, and snippets.

@David-Estevez
Created January 22, 2017 18:03
Show Gist options
  • Save David-Estevez/b06c3c2bd115508954aa62f517a61821 to your computer and use it in GitHub Desktop.
Save David-Estevez/b06c3c2bd115508954aa62f517a61821 to your computer and use it in GitHub Desktop.
Rename Ebook acording to the PDF's title and author metadata
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