Skip to content

Instantly share code, notes, and snippets.

@EldonMcGuinness
Created February 10, 2018 23:09
Show Gist options
  • Save EldonMcGuinness/c602e910754ed4d5fdb97a3494834eae to your computer and use it in GitHub Desktop.
Save EldonMcGuinness/c602e910754ed4d5fdb97a3494834eae to your computer and use it in GitHub Desktop.
Convert epub to mobi using calibre, see included note for bulk converting
#!/bin/bash
FILE=$(basename "$1" .epub)
if [ -e "${FILE}.mobi" ]; then
echo nothing to do
else
echo converting
ebook-convert "${FILE}.epub" "${FILE}.mobi"
fi
# NOTE:
# To bulk convert use a function like GNU find as follows
# find /some/director/here -mindepth 1 -type f -iname "*.epub" -execdir epub2mobi "{}" \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment