Skip to content

luiztosk/tipsntricks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 

Repository files navigation

Convert multiple ebooks from .epub to .mobi in parallel

Kindle accepts .mobi files directly, just copy them to the root documents folder. To convert from the more common .epub, we can use the calibre CLI utility ebook-convert.

To run multiple instances in parallel, converting all .epub files in current dir, and log each process into a .log with the same name, do:

foreach x (*.epub) {
    echo -e "\n$x";
    ebook-convert $x .mobi > "$x".log 2>&1 & 
}

In the 3rd line, > redirects stdin to the file "$x".log, and 2>&1 redirects stderr to stdin to log them together. The final & runs ebook-convert as a background process, that can be monitored in htop with the printed PID, or using the jobs utility.

About

useful shell and programming tips I've collected

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published